createObservableUpDownCounter#
Fully qualified name: omni::observability::createObservableUpDownCounter
Defined in omni/observability/IMetrics.h
-
template<class ValueType>
carb::ObjectPtr<IObservableInstrument> omni::observability::createObservableUpDownCounter( - const carb::ObjectPtr<IMeter> &meter,
- ObservableInstrumentCallback<ValueType> callback,
- void *context,
- carb::cpp::string_view name,
- carb::cpp::string_view description,
- carb::cpp::string_view unit = "",
Create an observable up/down counter instrument with the specified ValueType.
Remark
This is a convenience namespace-scope function template that is implemented in terms of the corresponding IMeter member function template. The
meterargument is permitted to be null, in which case a null instrument pointer is returned.- Parameters:
meter – [in] The meter to create the observable up/down counter with.
callback – [in] The callback function to invoke for sampling the counter value.
context – [in] User-defined context passed to the callback.
name – [in] The name of the observable up/down counter instrument.
description – [in] A description of what the observable up/down counter measures.
unit – [in] The unit of measurement (e.g., “bytes”, “connections”).
- Returns:
An carb::ObjectPtr to the created observable up/down counter, or nullptr on failure.