createUpDownCounter#

Fully qualified name: omni::observability::createUpDownCounter

Defined in omni/observability/IMetrics.h

template<class ValueType>
carb::ObjectPtr<IUpDownCounter<ValueType>> omni::observability::createUpDownCounter(
const carb::ObjectPtr<IMeter> &meter,
carb::cpp::string_view name,
carb::cpp::string_view description,
carb::cpp::string_view unit = "",
)#

Create an 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 meter argument is permitted to be null, in which case a null instrument pointer is returned.

Remark

Namespace-scope instrument manipulators (e.g. add) defined further down can be called with a null instrument pointer.

Parameters:
  • meter[in] The meter to create the up/down counter with.

  • name[in] The name of the up/down counter instrument.

  • description[in] A description of what the up/down counter measures.

  • unit[in] The unit of measurement (e.g., “bytes”, “connections”).

Returns:

An carb::ObjectPtr to the created up/down counter, or nullptr on failure.