[#BloombergLP-bdlm-MetricsRegistry]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlm.adoc[bdlm]::MetricsRegistry
:relfileprefix: ../../
:mrdocs:

This class implements a transferable registry of metrics&period;

== Synopsis

Declared in `&lt;bdlm&lowbar;metricsregistry&period;h&gt;`

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

== Description

This class implements a mechanism that provides a registry of metrics that is transferable to implementations of the `bdlm&colon;&colon;MetricsAdapter` protocol&period; This class is _usually_ a singleton&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlm/MetricsRegistry/Callback.adoc[`Callback`] 
| This `typedef` is an alias for a metrics registration callback&period;
| xref:BloombergLP/bdlm/MetricsRegistry/CallbackHandle.adoc[`CallbackHandle`] 
| This `typedef` is an alias for a metrics registration callback handle&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlm/MetricsRegistry/2constructor.adoc[`MetricsRegistry`]         [.small]#[constructor]#
| Create a registry that can forward metric registrations to an adapter&period;
| xref:BloombergLP/bdlm/MetricsRegistry/2destructor.adoc[`&#126;MetricsRegistry`] [.small]#[destructor]#
| Unregister all registered metrics and destroy this `MetricsRegistry` object&period;
| xref:BloombergLP/bdlm/MetricsRegistry/allocator.adoc[`allocator`] 
| Return the allocator used by this object to supply memory&period;
| xref:BloombergLP/bdlm/MetricsRegistry/disableMetricsCollection.adoc[`disableMetricsCollection`] 
| Disable metrics collection&period;
| xref:BloombergLP/bdlm/MetricsRegistry/enableMetricsCollection.adoc[`enableMetricsCollection`] 
| Enable metrics collection&period;
| xref:BloombergLP/bdlm/MetricsRegistry/numRegisteredCollectionCallbacks.adoc[`numRegisteredCollectionCallbacks`] 
| Return the number of registered metrics collection callbacks&period;
| xref:BloombergLP/bdlm/MetricsRegistry/registerCollectionCallback.adoc[`registerCollectionCallback`] 
| Register a metric collection callback and load a handle into `result`&period;
| xref:BloombergLP/bdlm/MetricsRegistry/removeMetricsAdapter.adoc[`removeMetricsAdapter`] 
| Remove `adapter` if it is the adapter associated with this registry&period;
| xref:BloombergLP/bdlm/MetricsRegistry/setMetricsAdapter.adoc[`setMetricsAdapter`] 
| Configure this registry to use the specified `adapter`&period;
| xref:BloombergLP/bdlm/MetricsRegistry/2conversion.adoc[`operator BloombergLP::bslmf::NestedTraitDeclaration&lt;MetricsRegistry, UsesBslmaAllocator&gt;`] 
| Declare that this type uses a `bslma` allocator&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bdlm/MetricsRegistry/defaultInstance.adoc[`defaultInstance`] 
| Return a non&hyphen;`const` reference to the metrics registry singleton&period;
|===



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