44 void set(
const std::string_view state,
const bool active)
const noexcept {
45 const auto [adapter, handle] = this->
bind();
46 adapter->set_state(handle, state, active);
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
StateSet make_child(const Labels &dynamic) const noexcept
Resolve a labeled child of the same metric type.
Definition metric_base.hpp:458
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
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
A state set: each declared state is a boolean, exposed as one series per state with value 0 or 1.
Definition stateset.hpp:27
StateSet(std::shared_ptr< MetricCore > core)
Definition stateset.hpp:41
StateSet(const std::string_view name, const std::string_view help)
Definition stateset.hpp:29
StateSet(const StateSetSpec &spec)
Definition stateset.hpp:32
StateSet labels(const Labels &dynamic) const noexcept
Definition stateset.hpp:49
void set(const std::string_view state, const bool active) const noexcept
Set the boolean value of one state.
Definition stateset.hpp:44
MetricCore (the shared per-series state) and the CRTP MetricBase that gives every metric type value s...
Definition adapter.hpp:24
MetricType
The OpenMetrics / Prometheus metric kinds prom understands.
Definition unit.hpp:15
Declarative description of a state set.
Definition stateset.hpp:17
std::vector< std::string > states
Definition stateset.hpp:22
std::string_view name
Definition stateset.hpp:18
comms::DisplayInfo display
Definition stateset.hpp:21
std::string_view help
Definition stateset.hpp:19
Labels labels
Definition stateset.hpp:20