BDE 4.14.0 Production release
|
Provide a balm::Publisher
implementation that writes to a stream.
This component defines a concrete class balm::StreamPublisher
that implements the balm::Publisher
protocol for publishing metric records:
This implementation of the publisher protocol publishes records to an output stream that is supplied at construction.
Bloomberg software may alternatively use the GUTS telemetry API, which is integrated into Bloomberg infrastructure.
This section illustrates intended use of this component.
In the following example we illustrate how to create and publish records with a balm::StreamPublisher
. First we define a couple of metric ids. Note that we create the balm::MetricId
objects by hand, but in practice an id should be obtained from a balm::MetricRegistry
object (such as the one owned by a balm::MetricsManager
).
Now we create a balm::StreamPublisher
object, supplying it the stdout
stream:
Next we create a metric sample containing some records and pass it to the balm::StreamPublisher
we created. Note that because we are not actually collecting the metrics we set the elapsed time of the sample to an arbitrary 5s interval.
The output of this example would look similar to: