A prometheus counter metric implementation. It can only be increased or be reset to zero.
More...
|
template<impl::SomeCounterImpl ImplType = impl::CounterImpl<ValueType>>
requires std::same_as<ValueType, typename std::remove_cvref_t<ImplType>::ValueType> |
| AnyCounter (std::string name, std::string labelsString, ImplType &&impl=ImplType{}) |
| Construct a new AnyCounter object.
|
|
AnyCounter & | operator++ () |
| Increase the counter by one.
|
|
AnyCounter & | operator+= (ValueType const value) |
| Increase the counter by the given value.
|
|
void | set (ValueType value) |
| Set the value of the counter.
|
|
void | reset () |
| Reset the counter to zero.
|
|
ValueType | value () const |
| Get the value of the counter.
|
|
void | serializeValue (OStream &stream) const override |
| Serialize the counter to a string in prometheus format (i.e. name{labels} value)
|
|
| 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"}.
|
|
template<SomeCounterImpl ImplType = CounterImpl<ValueType>>
requires std::same_as<ValueType, typename std::remove_cvref_t<ImplType>::ValueType> |
| AnyCounterBase (ImplType &&impl=ImplType{}) |
|
template<SomeNumberType NumberType>
struct util::prometheus::AnyCounter< NumberType >
A prometheus counter metric implementation. It can only be increased or be reset to zero.
- Template Parameters
-
NumberType | The type of the value of the counter |