BDE 4.14.0 Production release
|
Provide a description for a metric.
This component provides a class, balm::MetricDescription
, used to describe a metric. A balm::MetricDescription
object contains the address of the category to which the metric belongs and also the address of the null-terminated string holding the name of the metric. The balm::MetricDescription
class suppresses copy construction and assignment, and does not provide equality operators: Applications should use a single balm::MetricDescription
object per metric (such as one provided by the *balm::MetricRegistry
* component).
IMPORTANT: The metric description's name
, whose type is const char *
, must remain constant and valid throughout the lifetime of the balm::MetricDescription
object.
Bloomberg software may alternatively use the GUTS telemetry API, which is integrated into Bloomberg infrastructure.
balm::MetricDescription
is const thread-safe, meaning that accessors may be invoked concurrently from different threads, but it is not safe to access or modify a balm::MetricDescription
in one thread while another thread modifies the same object. However, clients of the balm
package accessing a non-modifiable balm::MetricDescription
supplied by a balm::MetricRegistry
(by way of a balm::MetricId
) can safely access the properties of that metric description at any time.
This section illustrates intended use of this component.
The following example demonstrates how to create and access a balm::MetricDescription
object. We start by creating a category:
Then we use that category to create three metric description objects with different names:
We can use the category
and name
methods to access their values:
Finally, we write all three metric descriptions to the console:
With the following console output: