|
BDE 4.14.0 Production release
|
Provide an aggregated record of the value of a metric.
This component implements an unconstrained pure-attribute class used to represent the aggregated value of a metric. A balm::MetricRecord contains a balm::MetricId object, and a set of aggregate values summarizing the recorded values for that metric. The attributes held by balm::MetricRecord are given in the following table:
Bloomberg software may alternatively use the GUTS telemetry API, which is integrated into Bloomberg infrastructure.
balm::MetricRecord 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::MetricRecord in one thread while another thread modifies the same object.
This section illustrates intended use of this component.
The following example demonstrates how a balm::MetricRecord can be used to describe a set of metric values. In the example we create a RequestProcessor class that collects information about the sizes of the requests it has processed. The RequestProcessor also provides a loadRequestSizeInformation method that populates a balm::MetricRecord object describing the sizes of the requests it has processed.
Now we declare a function that populates a balm::MetricRecord describing the sizes of the requests that the request processor has processed:
We can create an instance of this RequestProcessor class and use it to process a couple of requests:
Now we create a balm::MetricRecord to hold the aggregated metrics values. Note that we create a balm::MetricId object by hand, but in practice an id should be obtained from a balm::MetricRegistry object (such as the one owned by a balm::MetricsManager).
Finally we retrieve the information about the request sizes of the requests processed by requestProcessor. Note that the count of requests should be 2, the total size of the requests should be 8 (3 + 5), the minimum size should be 3, and the maximum size should be 5.