|
prom 0.1.0
Client-independent C++23 Prometheus/OpenMetrics metric abstraction
|
OpenMetrics unit suffix plus optional dimensional metadata. More...
#include <unit.hpp>

Public Member Functions | |
| constexpr bool | empty () const noexcept |
| A unit carries no information when it has neither a name nor a kind. | |
| bool | operator== (const Unit &) const =default |
Public Attributes | |
| std::string_view | name {} |
Human-readable unit name (e.g. "seconds"). | |
| std::string_view | kind {} |
Dimensional compatibility group (e.g. "time"). | |
| std::string_view | symbol {} |
Display symbol (e.g. "s"). | |
| bool | from_dimval = false |
| True when inferred from a dimval value. | |
OpenMetrics unit suffix plus optional dimensional metadata.
All string fields are std::string_view so that the built-in dimval descriptors — which return string_view literals — stay zero-copy. When a Unit is handed to an Adapter (via MetricMeta or Adapter::set_unit) the views must stay valid only for the duration of that call; backends copy what they need synchronously.
|
inlineconstexprnoexcept |
A unit carries no information when it has neither a name nor a kind.
|
default |
| bool prom::Unit::from_dimval = false |
True when inferred from a dimval value.
| std::string_view prom::Unit::kind {} |
Dimensional compatibility group (e.g. "time").
| std::string_view prom::Unit::name {} |
Human-readable unit name (e.g. "seconds").
| std::string_view prom::Unit::symbol {} |
Display symbol (e.g. "s").