Template Class UpDownCounter

Inheritance Relationships

Base Type

  • public opentelemetry::metrics::SynchronousInstrument

Derived Type

Class Documentation

template<class T>
class UpDownCounter : public opentelemetry::metrics::SynchronousInstrument

An up-down-counter instrument that adds or reduce values.

Subclassed by opentelemetry::metrics::NoopUpDownCounter< T >

Public Functions

virtual void Add(T value) noexcept = 0

Adds a value.

Parameters

value – The amount of the measurement.

virtual void Add(T value, const context::Context &context) noexcept = 0
virtual void Add(T value, const common::KeyValueIterable &attributes) noexcept = 0

Add a value with a set of attributes.

Parameters
  • value – The increment amount. May be positive, negative or zero.

  • attributes – A set of attributes to associate with the count.

virtual void Add(T value, const common::KeyValueIterable &attributes, const context::Context &context) noexcept = 0
template<class U, nostd::enable_if_t<common::detail::is_key_value_iterable<U>::value>* = nullptr>
inline void Add(T value, const U &attributes) noexcept
template<class U, nostd::enable_if_t<common::detail::is_key_value_iterable<U>::value>* = nullptr>
inline void Add(T value, const U &attributes, const context::Context &context) noexcept
inline void Add(T value, std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>> attributes) noexcept
inline void Add(T value, std::initializer_list<std::pair<nostd::string_view, common::AttributeValue>> attributes, const context::Context &context) noexcept