[#BloombergLP-balm-Collector] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::Collector :relfileprefix: ../../ :mrdocs: This class provides a mechanism for collecting and aggregating the value of a metric over a period of time. == Synopsis Declared in `<balm_collector.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class Collector; ---- == Description 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`. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/Collector/2constructor.adoc[`Collector`] [.small]#[constructor]# | Create a collector for a metric having the specified `metricId`. | xref:BloombergLP/balm/Collector/2destructor.adoc[`~Collector`] [.small]#[destructor]# | Destroy this object. | xref:BloombergLP/balm/Collector/accumulateCountTotalMinMax.adoc[`accumulateCountTotalMinMax`] | Accumulate the specified count, total, min, and max into this collector. | xref:BloombergLP/balm/Collector/load.adoc[`load`] | 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. | xref:BloombergLP/balm/Collector/loadAndReset.adoc[`loadAndReset`] | Load the current metric aggregates into the specified `record` and reset this collector. | xref:BloombergLP/balm/Collector/metricId.adoc[`metricId`] | Return a reference to the non‐modifiable `MetricId` object identifying the metric for which this object collects values. | xref:BloombergLP/balm/Collector/reset.adoc[`reset`] | Reset the count, total, minimum, and maximum values of the metric being collected to their default states. | xref:BloombergLP/balm/Collector/setCountTotalMinMax.adoc[`setCountTotalMinMax`] | Set the count, total, min, and max aggregates to the specified values. | xref:BloombergLP/balm/Collector/update.adoc[`update`] | Update the collected aggregates with the specified `value`. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#