IUpDownCounter#

Fully qualified name: omni::observability::IUpDownCounter

Defined in omni/observability/IMetrics.h

template<class ValueType_>
class IUpDownCounter : public carb::IObject#

Up/down counter instrument for values that can increase or decrease.

Remark

Up/down counters are used to measure values that can go up or down, such as active connections, queue size, or memory usage. Values can be positive or negative.

Public Types

using ValueType = ValueType_#

The value type for this up/down counter (e.g., std::int64_t or double).

Public Functions

virtual ~IUpDownCounter() = default#
virtual void addArr(
ValueType value,
const Attribute attributes[],
std::size_t attributeCount,
) noexcept = 0#

Add a value to the up/down counter with attributes.

Parameters:
  • value[in] The value to add to the counter. Can be positive or negative.

  • attributes[in] Array of attributes to associate with this measurement.

  • attributeCount[in] Number of attributes in the array.

template<class T, class ...A>
inline void add(
T value,
A&&... a,
) noexcept#

Add a value to the up/down counter with variadic attributes.

Parameters:
  • value[in] The value to add to the counter. Can be positive or negative.

  • a[in] Variadic list of attributes to associate with this measurement.

template<class T>
inline void add(
T value,
std::initializer_list<Attribute> attributes,
) noexcept#

Add a value to the up/down counter with initializer list of attributes.

Parameters:
  • value[in] The value to add to the counter. Can be positive or negative.

  • attributes[in] Initializer list of attributes to associate with this measurement.

virtual size_t addRef() = 0#

Atomically add one to the reference count.

Returns:

The current reference count after one was added, though this value may change before read if other threads are also modifying the reference count. The return value is guaranteed to be non-zero.

virtual size_t release() = 0#

Atomically subtracts one from the reference count.

If the result is zero, carb::deleteHandler() is called for this.

Returns:

The current reference count after one was subtracted. If zero is returned, carb::deleteHandler() was called for this.

Public Static Functions

static inline constexpr carb::InterfaceDesc getInterfaceDesc(
) noexcept#

Returns information about this interface.

Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.

Returns:

The carb::InterfaceDesc struct with information about this interface.

static inline constexpr carb::InterfaceDesc getLatestInterfaceDesc(
) noexcept#

Returns information about the latest version of this interface.

Auto-generated by CARB_PLUGIN_INTERFACE() or CARB_PLUGIN_INTERFACE_EX.

Returns:

The carb::InterfaceDesc struct with information about the latest version of this interface.