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

This class implements a manager for the recording and publishing of metrics&period;

== Synopsis

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

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

== Description

Metrics managed by a `MetricsManager` are grouped into categories identified by a string&period; The metrics manager allows clients to register a `Publisher` object using the `addGeneralPublisher` and `addSpecificPublisher` operations&period; Metrics can be recorded in one of two ways&colon; Clients can (1) implement their own metric collection facilities and register a callback using this metric manager&apos;s `registerMetricsCallback` method&semi; or (2) use the `Collector` objects available from the `CollectorRepository` owned by this metrics manager&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/MetricsManager/CallbackHandle.adoc[`CallbackHandle`] 
| Identifies a registered `RecordsCollectionCallback`&period;
| xref:BloombergLP/balm/MetricsManager/RecordsCollectionCallback.adoc[`RecordsCollectionCallback`] 
| Alias for a callback that collects metric records and optionally resets them&period;
|===


== Enums

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/MetricsManager/_04enum.adoc[`Unnamed enum`] 
| Callback handle constants&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/balm/MetricsManager/2constructor.adoc[`MetricsManager`]         [.small]#[constructor]#
| Create a `MetricsManager`&period;
| xref:BloombergLP/balm/MetricsManager/2destructor.adoc[`&#126;MetricsManager`] [.small]#[destructor]#
| Destroy this `MetricsManager`&period;
| xref:BloombergLP/balm/MetricsManager/addGeneralPublisher.adoc[`addGeneralPublisher`] 
| Add a publisher used for every category published by this manager&period;
| xref:BloombergLP/balm/MetricsManager/addSpecificPublisher-06.adoc[`addSpecificPublisher`] 
| `addSpecificPublisher` overloads
| xref:BloombergLP/balm/MetricsManager/collectSample-0c.adoc[`collectSample`] 
| `collectSample` overloads
| xref:BloombergLP/balm/MetricsManager/collectorRepository-077.adoc[`collectorRepository`] 
| `collectorRepository` overloads
| xref:BloombergLP/balm/MetricsManager/findGeneralPublishers-09.adoc[`findGeneralPublishers`] 
| `findGeneralPublishers` overloads
| xref:BloombergLP/balm/MetricsManager/findSpecificPublishers-02.adoc[`findSpecificPublishers`] 
| `findSpecificPublishers` overloads
| xref:BloombergLP/balm/MetricsManager/metricRegistry-0f.adoc[`metricRegistry`] 
| `metricRegistry` overloads
| xref:BloombergLP/balm/MetricsManager/publish-028.adoc[`publish`] 
| `publish` overloads
| xref:BloombergLP/balm/MetricsManager/publishAll-027.adoc[`publishAll`] 
| `publishAll` overloads
| xref:BloombergLP/balm/MetricsManager/registerCollectionCallback-0a.adoc[`registerCollectionCallback`] 
| `registerCollectionCallback` overloads
| xref:BloombergLP/balm/MetricsManager/removeCollectionCallback.adoc[`removeCollectionCallback`] 
| Remove the callback associated with the specified `handle`&period;
| xref:BloombergLP/balm/MetricsManager/removePublisher-099.adoc[`removePublisher`] 
| `removePublisher` overloads
| xref:BloombergLP/balm/MetricsManager/setAllCategoriesEnabled.adoc[`setAllCategoriesEnabled`] 
| Set whether all registered categories are enabled to the specified `value`&period;
| xref:BloombergLP/balm/MetricsManager/setCategoryEnabled-0c.adoc[`setCategoryEnabled`] 
| `setCategoryEnabled` overloads
| xref:BloombergLP/balm/MetricsManager/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;MetricsManager, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:BloombergLP/balm/MetricsManager_PublicationHelper.adoc[BloombergLP::balm::MetricsManager&lowbar;PublicationHelper]`
| defined in implementation
|===


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