Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::MetricEvent Concept Referenceexport

An event type representing a metric measurement. More...

#include <event.h>

Concept definition

template<typename T>
concept kcenon::common::concepts::MetricEvent = EventType<T> && requires(const T t) {
{ t.name } -> std::convertible_to<std::string>;
{ t.value } -> std::convertible_to<double>;
{ t.unit } -> std::convertible_to<std::string>;
}
A type that can be used as an event in the event bus.
Definition event.h:52
An event type representing a metric measurement.
Definition event.h:176

Detailed Description

An event type representing a metric measurement.

Metric events include a name, value, and optional unit for monitoring and observability purposes.

Example usage:

template<MetricEvent E>
void record_metric(const E& event) {
metrics_system.record(event.name, event.value, event.unit);
}

Definition at line 176 of file event.h.