createHistogram#

Fully qualified name: omni::observability::createHistogram

Defined in omni/observability/IMetrics.h

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

Create a histogram 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. record) defined further down can be called with a null instrument pointer.

Parameters:
  • meter[in] The meter to create the histogram with.

  • name[in] The name of the histogram instrument.

  • description[in] A description of what the histogram measures.

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

Returns:

An carb::ObjectPtr to the created histogram, or nullptr on failure.