26 Untyped(
const std::string_view
name,
const std::string_view help)
36 core_->has_unit =
true;
48 requires std::is_arithmetic_v<T>
49 void set(T value)
noexcept {
54 template <DimensionalValue V>
55 void set(
const V& value)
noexcept {
65 const auto [adapter, handle] = this->
bind();
72 adapter->set(handle, nv.value);
An immutable-by-convention set of labels, kept sorted by name with duplicates collapsed last-wins.
Definition labels.hpp:55
CRTP base shared by every metric type.
Definition metric_base.hpp:377
Untyped make_child(const Labels &dynamic) const noexcept
Resolve a labeled child of the same metric type.
Definition metric_base.hpp:458
bool reconcile_unit(const Unit &observed, Adapter &adapter) const noexcept
Reconcile an observed unit against the family's known unit.
Definition metric_base.hpp:475
std::string_view name() const noexcept
The metric's fully-qualified name.
Definition metric_base.hpp:380
const std::shared_ptr< MetricCore > & core() const noexcept
Definition metric_base.hpp:449
bool check_finite(const double value, std::string_view op) const noexcept
Drop-and-log guard for a non-finite sample.
Definition metric_base.hpp:514
std::shared_ptr< MetricCore > core_
Definition metric_base.hpp:530
Binding bind() const noexcept
Resolve the adapter and backend handle this metric should record against.
Definition metric_base.hpp:435
An untyped metric: just a settable value.
Definition untyped.hpp:24
Untyped(const UntypedSpec &spec)
Definition untyped.hpp:29
void set(T value) noexcept
Set to a raw value.
Definition untyped.hpp:49
void set(const V &value) noexcept
Set to a dimensional value.
Definition untyped.hpp:55
Untyped labels(const Labels &dynamic) const noexcept
Definition untyped.hpp:59
Untyped(const std::string_view name, const std::string_view help)
Definition untyped.hpp:26
Untyped(std::shared_ptr< MetricCore > core)
Definition untyped.hpp:44
MetricCore (the shared per-series state) and the CRTP MetricBase that gives every metric type value s...
Definition adapter.hpp:24
NormalizedValue normalize(const V &value)
Reduce a dimval value to a NormalizedValue.
Definition dimval.hpp:47
MetricType
The OpenMetrics / Prometheus metric kinds prom understands.
Definition unit.hpp:15
A plain magnitude paired with the unit it was carrying (empty for raw arithmetic).
Definition dimval.hpp:36
OpenMetrics unit suffix plus optional dimensional metadata.
Definition unit.hpp:53
std::string_view kind
Dimensional compatibility group (e.g. "time").
Definition unit.hpp:55
bool from_dimval
True when inferred from a dimval value.
Definition unit.hpp:57
std::string_view name
Human-readable unit name (e.g. "seconds").
Definition unit.hpp:54
constexpr bool empty() const noexcept
A unit carries no information when it has neither a name nor a kind.
Definition unit.hpp:60
std::string_view symbol
Display symbol (e.g. "s").
Definition unit.hpp:56
Declarative description of an untyped metric.
Definition untyped.hpp:14
Unit unit
Definition untyped.hpp:18
Labels labels
Definition untyped.hpp:17
std::string_view help
Definition untyped.hpp:16
std::string_view name
Definition untyped.hpp:15
comms::DisplayInfo display
Definition untyped.hpp:19