|
Common System 0.2.0
Common interfaces and patterns for system integration
|
No-op implementation for when metrics are disabled. More...
#include <metric_collector_interface.h>


Public Member Functions | |
| void | increment (std::string_view, double=1.0, const metric_labels &={}) override |
| Increment a counter metric. | |
| void | gauge (std::string_view, double, const metric_labels &={}) override |
| Set a gauge metric to an absolute value. | |
| void | histogram (std::string_view, double, const metric_labels &={}) override |
| Record a histogram observation. | |
| void | timing (std::string_view, std::chrono::nanoseconds, const metric_labels &={}) override |
| Record a timing measurement. | |
| std::string | get_implementation_name () const override |
| Get the implementation name for logging/debugging. | |
Public Member Functions inherited from kcenon::common::interfaces::IMetricCollector | |
| virtual | ~IMetricCollector ()=default |
No-op implementation for when metrics are disabled.
This implementation silently discards all metrics, useful for:
Example usage:
Definition at line 223 of file metric_collector_interface.h.
|
inlineoverridevirtual |
Set a gauge metric to an absolute value.
Gauges represent instantaneous values that can go up or down, such as temperature, memory usage, or active connections.
| name | Metric name |
| value | Current value (can be negative) |
| labels | Optional dimensional labels |
Implements kcenon::common::interfaces::IMetricCollector.
Definition at line 229 of file metric_collector_interface.h.
|
inlinenodiscardoverridevirtual |
Get the implementation name for logging/debugging.
Implements kcenon::common::interfaces::IMetricCollector.
Definition at line 241 of file metric_collector_interface.h.
|
inlineoverridevirtual |
Record a histogram observation.
Histograms track the distribution of values across configurable buckets, useful for measuring sizes, counts, or any discrete values.
| name | Metric name |
| value | Observed value |
| labels | Optional dimensional labels |
Implements kcenon::common::interfaces::IMetricCollector.
Definition at line 233 of file metric_collector_interface.h.
|
inlineoverridevirtual |
Increment a counter metric.
Counters are monotonically increasing values, typically used for counting events (requests, errors, completed jobs, etc.).
| name | Metric name (should follow naming conventions, e.g., snake_case) |
| value | Increment value (default: 1.0, must be non-negative) |
| labels | Optional dimensional labels for filtering/grouping |
Implements kcenon::common::interfaces::IMetricCollector.
Definition at line 225 of file metric_collector_interface.h.
|
inlineoverridevirtual |
Record a timing measurement.
Timing metrics are specialized histograms for duration measurements. Implementations may convert to appropriate units (ms, s, etc.).
| name | Metric name |
| duration | Duration measurement |
| labels | Optional dimensional labels |
Implements kcenon::common::interfaces::IMetricCollector.
Definition at line 237 of file metric_collector_interface.h.