IGauge#

Fully qualified name: omni::observability::IGauge

Defined in omni/observability/IMetrics.h

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

Gauge instrument for recording instantaneous values.

Remark

Gauges are used to measure values that can arbitrarily go up or down, such as current temperature, current memory usage, or current queue size. Unlike counters which accumulate values, gauges record the current value at the time of recording.

Public Types

using ValueType = ValueType_#

The value type for this gauge (e.g., std::int64_t or double).

Public Functions

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

Record a value in the gauge with attributes.

Parameters:
  • value[in] The current value to record.

  • 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 record(
T value,
A&&... a,
) noexcept#

Record a value in the gauge with variadic attributes.

Parameters:
  • value[in] The current value to record.

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

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

Record a value in the gauge with initializer list of attributes.

Parameters:
  • value[in] The current value to record.

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