Template Class UpDownCounter

Inheritance Relationships

Derived Type

Class Documentation

template<class T>
class UpDownCounter

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

Record a value.

Parameters:

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

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

Record a value.

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

  • context – The explicit context to associate with this measurement.

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

Record 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

Record 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.

  • context – The explicit context to associate with this measurement.

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