[#BloombergLP-balm-IntegerMetric]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/balm.adoc[balm]::IntegerMetric
:relfileprefix: ../../
:mrdocs:

This class provides an in&hyphen;core value semantic type for recording and aggregating the values of an integer metric&period; The value of a `IntegerMetric` object is characterized by the `IntegerCollector` object it uses to collect metric&hyphen;event values&period; Each instance of this class establishes (at construction) an association to an `IntegerCollector` object to which the metric delegates&period; A `IntegerMetric` value is constant after construction (i&period;e&period;, 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&period; 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&period;e&period;, `isActive()` is `false`) and the manipulator methods of the integer metric object will have no effect&period;

== Synopsis

Declared in `&lt;balm&lowbar;integermetric&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class IntegerMetric;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/IntegerMetric/2constructor-0f7.adoc[`IntegerMetric`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/balm/IntegerMetric/accumulateCountTotalMinMax.adoc[`accumulateCountTotalMinMax`] 
| Increase the event count by the specified `count` and add the specified `total` to the accumulated total&semi; if the specified `min` is less than the current minimum recorded value of the metric, set the new minimum value to be `min`&semi; if the specified `max` is greater than the current maximum recorded value, set the new maximum value to be `max`&period; If, however, this integer metric is inactive (i&period;e&period;, `isActive()` is `false`), then this method has no effect&period;
| xref:BloombergLP/balm/IntegerMetric/collector-07.adoc[`collector`] 
| `collector` overloads
| xref:BloombergLP/balm/IntegerMetric/increment.adoc[`increment`] 
| Increase the count and total of this integer metric by 1&semi; if 1 is less than the current minimum recorded value of the metric, set the new minimum value to be 1&semi; if 1 is greater than the current maximum recorded value, set the new maximum value to be 1&period; If, however, this integer metric is not active (i&period;e&period;, `isActive()` is `false`), then this method has no effect&period; Note that this method is functionally equivalent to `update(1)&period;`
| xref:BloombergLP/balm/IntegerMetric/isActive.adoc[`isActive`] 
| Return `true` if this integer metric will actively record metrics, and `false` otherwise&period; If the returned value is `false`, the manipulator operations will have no effect&period; An integer metric will be inactive if either (1) it was not initialized with a valid metric identifier or (2) the associated metric category has been disabled (see the `MetricsManager` method `setCategoryEnabled`)&period; Note that invoking this method is logically equivalent to the expression `0 !&equals; collector() &amp;&amp; metricId()&period;category()&hyphen;&gt;enabled()`&period;
| xref:BloombergLP/balm/IntegerMetric/metricId.adoc[`metricId`] 
| Return a `MetricId` object identifying this integer metric&period; If this metric was not supplied a valid integer collector at construction then the returned id will be invalid (i&period;e&period;, `metricId()&period;isValid()` is `false`)&period;
| xref:BloombergLP/balm/IntegerMetric/update.adoc[`update`] 
| Increase the event count by 1 and add the specified `value` to the total recorded value&semi; if `value` is less than the current minimum recorded value of the metric, set the new minimum value to be `value`&semi; if `value` is greater than the current maximum recorded value, set the new maximum value to be `value`&period; If, however, this integer metric is inactive (i&period;e&period;, `isActive()` is `false`), then this method has no effect&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/IntegerMetric/lookupCollector-038.adoc[`lookupCollector`] 
| `lookupCollector` overloads
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/operator_not_eq-0c.adoc[`operator!&equals;`]
| Return `true` if the specified `lhs` and `rhs` integer metrics do not have the same value and `false` otherwise&period; Two integer metrics do not have the same value if they record measurements using different integer collector objects or if one, but not both, have a null collector (i&period;e&period;, `collector()` is 0)&period;
| xref:BloombergLP/balm/operator_eq-0eb.adoc[`operator&equals;&equals;`]
| Return `true` if the specified `lhs` and `rhs` integer metrics have the same value and `false` otherwise&period; Two integer metrics have the same value if they record measurements using the same integer collector object or if they both have null collectors (i&period;e&period;, `collector()` is 0)&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
