This class defines a thread‐aware mechanism for registering metrics and metric categories.

Synopsis

Declared in <balm_metricregistry.h>

class MetricRegistry;

Description

A metric is uniquely identified by its name and category, and the metric registry provides a mapping from those identifying properties to a balm::MetricId. A balm::MetricRegistry object also provides a mapping from a category name to the address of a non‐modifiable balm::Category object.

Member Functions

Name

Description

MetricRegistry [constructor]

Create an empty metric registry.

~MetricRegistry [destructor]

Destroy this metric registry.

addCategory

Add category to this registry unless it is already registered.

addId

Add a metric id for category and name if not already registered.

createUserDataKey

Return a new unique key for associating user data with metrics.

findCategory

Find the registered category named category.

findId

Find the metric id for category and name in this registry.

getAllCategories

Append to the specified categories the addresses of all the categories registered by this balm::MetricRegistry object.

getCategory

Return the category for category, registering it if needed.

getId

Return a metric id for category and name, registering if needed.

numCategories

Return the number of categories in this registry.

numMetrics

Return the number of metrics in this registry.

print

Format this object to the specified output stream.

registerCategoryHolder

Register holder with category in this registry.

setAllCategoriesEnabled

Set the enabled state of all categories to value.

setCategoryEnabled

Set whether category is enabled to value.

setFormat

Set the format for metricId to format.

setPreferredPublicationType

Set the preferred publication type of metric to type.

setUserData

setUserData overloads

operator BloombergLP::bslmf::NestedTraitDeclaration<MetricRegistry, UsesBslmaAllocator>

Declare that this type uses a bslma allocator.

Created with MrDocs