BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balm::IntegerCollector Class Reference

#include <balm_integercollector.h>

Public Member Functions

 IntegerCollector (const MetricId &metricId)
 
 ~IntegerCollector ()
 Destroy this object.
 
void reset ()
 
void loadAndReset (MetricRecord *records)
 
void update (int value)
 
void accumulateCountTotalMinMax (int count, int total, int min, int max)
 
void setCountTotalMinMax (int count, int total, int min, int max)
 
const MetricIdmetricId () const
 
void load (MetricRecord *record) const
 

Static Public Attributes

static const int k_DEFAULT_MIN
 
static const int k_DEFAULT_MAX
 
static const int DEFAULT_MIN
 
static const int DEFAULT_MAX
 

Detailed Description

This class provides a mechanism for collecting and aggregating the value of an integer metric over a period of time. The collector contains a MetricId object identifying the metric being collected, the number of times an event occurred, and the total, minimum, and maximum aggregates of the associated measurement value. The default value for the count is 0, the default value for the total is 0, the default value for the minimum is k_DEFAULT_MIN, and the default value for the maximum is k_DEFAULT_MAX.

See balm_integercollector

Constructor & Destructor Documentation

◆ IntegerCollector()

balm::IntegerCollector::IntegerCollector ( const MetricId metricId)
inline

Create an integer collector for a metric having the specified metricId, and having an initial count of 0, total of 0, min of k_DEFAULT_MIN, and max of k_DEFAULT_MAX.

◆ ~IntegerCollector()

balm::IntegerCollector::~IntegerCollector ( )
inline

Member Function Documentation

◆ accumulateCountTotalMinMax()

void balm::IntegerCollector::accumulateCountTotalMinMax ( int  count,
int  total,
int  min,
int  max 
)
inline

Increment the event count by the specified count, add the specified total to the accumulated total, and if the specified min is less than the minimum value, set min to be the minimum value, and if the specified max is greater than the maximum value, set max to be the maximum value.

◆ load()

void balm::IntegerCollector::load ( MetricRecord record) const

Load into the specified record the id of the metric being collected, as well as the current count, total, minimum, and maximum aggregated values for the metric. Note that k_DEFAULT_MIN != MetricRecord::k_DEFAULT_MIN and k_DEFAULT_MAX != MetricRecord::k_DEFAULT_MAX; when populating record, this operation will convert default values for minimum and maximum. A minimum value of k_DEFAULT_MIN will populate a minimum value of MetricRecord::k_DEFAULT_MIN and a maximum value of k_DEFAULT_MAX will populate a maximum value of MetricRecord::k_DEFAULT_MAX.

◆ loadAndReset()

void balm::IntegerCollector::loadAndReset ( MetricRecord records)

Load into the specified record the id of the metric being collected as well as the current count, total, minimum, and maximum aggregated values for that metric; then reset the count, total, minimum, and maximum values to their default states. After this operation, the count and total values will be 0, the minimum value will be k_DEFAULT_MIN, and the maximum value will be k_DEFAULT_MAX. Note that k_DEFAULT_MIN != MetricRecord::k_DEFAULT_MIN and k_DEFAULT_MAX != MetricRecord::k_DEFAULT_MAX; when populating record, this operation will convert default values for minimum and maximum. A minimum value of k_DEFAULT_MIN will populate a minimum value of MetricRecord::k_DEFAULT_MIN and a maximum value of k_DEFAULT_MAX will populate a maximum value of MetricRecord::k_DEFAULT_MAX.

◆ metricId()

const MetricId & balm::IntegerCollector::metricId ( ) const
inline

Return a reference to the non-modifiable MetricId object identifying the metric for which this object collects values.

◆ reset()

void balm::IntegerCollector::reset ( )
inline

Reset the count, total, minimum, and maximum values of the metric being collected to their default states. After this operation, the count and total values will be 0, the minimum value will be k_DEFAULT_MIN, and the maximum value will be k_DEFAULT_MAX.

◆ setCountTotalMinMax()

void balm::IntegerCollector::setCountTotalMinMax ( int  count,
int  total,
int  min,
int  max 
)
inline

Set the event count to the specified count, the total aggregate to the specified total, the minimum aggregate to the specified min and the maximum aggregate to the specified max.

◆ update()

void balm::IntegerCollector::update ( int  value)
inline

Increment the event count by 1, add the specified value to the total, if value is less than the minimum value, set value to be the minimum value, and if value is greater than the maximum value, set value to be the maximum value.

Member Data Documentation

◆ DEFAULT_MAX

const int balm::IntegerCollector::DEFAULT_MAX
static

◆ DEFAULT_MIN

const int balm::IntegerCollector::DEFAULT_MIN
static

◆ k_DEFAULT_MAX

const int balm::IntegerCollector::k_DEFAULT_MAX
static

◆ k_DEFAULT_MIN

const int balm::IntegerCollector::k_DEFAULT_MIN
static

The documentation for this class was generated from the following file: