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

#include <balm_collector.h>

Public Member Functions

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

Detailed Description

This class provides a mechanism for collecting and aggregating the value of a metric over a period of time. The collector contains a MetricRecord object that holds the identity of 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.0, the default minimum value is MetricRecord::k_DEFAULT_MIN, and the default maximum value is MetricRecord::k_DEFAULT_MAX.

See balm_collector

Constructor & Destructor Documentation

◆ Collector()

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

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

◆ ~Collector()

balm::Collector::~Collector ( )
inline

Member Function Documentation

◆ accumulateCountTotalMinMax()

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

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

◆ load()

void balm::Collector::load ( MetricRecord record) const
inline

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.

◆ loadAndReset()

void balm::Collector::loadAndReset ( MetricRecord record)
inline

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 MetricRecord::k_DEFAULT_MIN, and the maximum value will be MetricRecord::k_DEFAULT_MAX. Note that this operation is logically equivalent to calling the load and then the reset methods except that it is performed as a single atomic operation.

◆ metricId()

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

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

◆ reset()

void balm::Collector::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 MetricRecord::k_DEFAULT_MIN, and the maximum value will be MetricRecord::k_DEFAULT_MAX.

◆ setCountTotalMinMax()

void balm::Collector::setCountTotalMinMax ( int  count,
double  total,
double  min,
double  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::Collector::update ( double  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.


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