|
Clio
develop
The XRP Ledger API server.
|
Base class for a Prometheus metric containing a name and labels. More...
#include <MetricBase.hpp>

Public Member Functions | |
| MetricBase (std::string name, std::string labelsString) | |
| Construct a new MetricBase object. | |
| MetricBase (MetricBase const &)=delete | |
| MetricBase (MetricBase &&)=default | |
| MetricBase & | operator= (MetricBase const &)=delete |
| MetricBase & | operator= (MetricBase &&)=default |
| std::string const & | name () const |
| Get the name of the metric. | |
| std::string const & | labelsString () const |
| Get the labels of the metric in serialized format, e.g. {name="value",name2="value2"}. | |
Protected Member Functions | |
| virtual void | serializeValue (OStream &stream) const =0 |
| Interface to serialize the value of the metric. | |
Friends | |
| OStream & | operator<< (OStream &stream, MetricBase const &metricBase) |
| Serialize the metric to a string in Prometheus format. | |
Base class for a Prometheus metric containing a name and labels.
| util::prometheus::MetricBase::MetricBase | ( | std::string | name, |
| std::string | labelsString ) |
Construct a new MetricBase object.
| name | The name of the metric |
| labelsString | The labels of the metric in serialized format, e.g. {name="value",name2="value2"} |
| std::string const & util::prometheus::MetricBase::labelsString | ( | ) | const |
Get the labels of the metric in serialized format, e.g. {name="value",name2="value2"}.
| std::string const & util::prometheus::MetricBase::name | ( | ) | const |
Get the name of the metric.
|
protectedpure virtual |
Interface to serialize the value of the metric.
| stream | The stream to serialize into |
Implemented in util::prometheus::AnyCounter< NumberType >, util::prometheus::AnyCounter< double >, util::prometheus::AnyCounter< std::uint64_t >, util::prometheus::AnyGauge< NumberType >, util::prometheus::AnyGauge< double >, util::prometheus::AnyGauge< std::int64_t >, util::prometheus::AnyHistogram< NumberType >, util::prometheus::AnyHistogram< double >, and util::prometheus::AnyHistogram< std::int64_t >.
|
friend |
Serialize the metric to a string in Prometheus format.
| stream | The stream to serialize into |
| metricBase | The metric to serialize |