[#BloombergLP-balm-Metric] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::Metric :relfileprefix: ../../ :mrdocs: This class provides an in‐core value semantic type for recording and aggregating the values of a metric. == Synopsis Declared in `<balm_metric.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class Metric; ---- == Description The value of a `Metric` object is characterized by the `Collector` object it uses to collect metric‐event values. Each instance of this class establishes (at construction) an association to a `Collector` object to which the metric delegates. A `Metric` value is constant after construction (i.e., it does not support assignment or provide manipulators that modify its collector value) so that synchronization primitives are not required to protect its data members. Note that if a collector or metrics manager is not supplied at construction, and if the default metrics manager has not been instantiated, then the metric will be inactive (i.e., `isActive() == false`) and the manipulator methods of the metric object will have no effect. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/Metric/2constructor-02.adoc[`Metric`] [.small]#[constructor]# | Constructors | xref:BloombergLP/balm/Metric/accumulateCountTotalMinMax.adoc[`accumulateCountTotalMinMax`] | Accumulate the specified `count`, `total`, `min`, and `max` into this metric. | xref:BloombergLP/balm/Metric/collector-00.adoc[`collector`] | `collector` overloads | xref:BloombergLP/balm/Metric/increment.adoc[`increment`] | Increase the count and total of this metric by 1. | xref:BloombergLP/balm/Metric/isActive.adoc[`isActive`] | Return `true` if this metric will actively record metrics, and `false` otherwise. | xref:BloombergLP/balm/Metric/metricId.adoc[`metricId`] | Return a `MetricId` object identifying this metric. | xref:BloombergLP/balm/Metric/update.adoc[`update`] | Increase the event count by 1 and add the specified `value` to the total recorded value. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/Metric/lookupCollector-0a.adoc[`lookupCollector`] | `lookupCollector` overloads |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/balm/operator_not_eq-099.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` metrics do not have the same value and `false` otherwise. | xref:BloombergLP/balm/operator_eq-02.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` metrics have the same value and `false` otherwise. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#