|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Adapter that wraps performance_monitor to implement IMonitor interface. More...
#include <performance_monitor_adapter.h>


Public Member Functions | |
| performance_monitor_adapter (std::shared_ptr< performance_monitor > monitor) | |
| Construct adapter with existing performance_monitor. | |
| common::VoidResult | record_metric (const std::string &name, double value) override |
| Record a simple metric value. | |
| common::VoidResult | record_metric (const std::string &name, double value, const std::unordered_map< std::string, std::string > &tags) override |
| Record a metric with additional tags. | |
| common::Result< common::interfaces::metrics_snapshot > | get_metrics () override |
| Get current metrics snapshot. | |
| common::Result< common::interfaces::health_check_result > | check_health () override |
| Perform health check on the performance_monitor. | |
| common::VoidResult | reset () override |
| Reset all metrics in the wrapped performance_monitor. | |
| std::shared_ptr< performance_monitor > | get_wrapped_monitor () const |
| Get the wrapped performance_monitor. | |
Private Attributes | |
| std::shared_ptr< performance_monitor > | monitor_ |
Adapter that wraps performance_monitor to implement IMonitor interface.
This adapter follows the Adapter design pattern to eliminate multiple inheritance. It provides a clean separation between the monitoring system's internal interface (metrics_collector) and the common system's standard interface (IMonitor).
Example usage:
Definition at line 45 of file performance_monitor_adapter.h.
|
inlineexplicit |
Construct adapter with existing performance_monitor.
| monitor | Shared pointer to the performance_monitor to wrap |
| std::invalid_argument | if monitor is nullptr |
Definition at line 52 of file performance_monitor_adapter.h.
References monitor_.
|
inlineoverride |
Perform health check on the performance_monitor.
Definition at line 169 of file performance_monitor_adapter.h.
References monitor_.
|
inlineoverride |
Get current metrics snapshot.
Definition at line 112 of file performance_monitor_adapter.h.
References monitor_, kcenon::monitoring::metric::name, kcenon::monitoring::metric::tags, kcenon::monitoring::metric::timestamp, and kcenon::monitoring::metric::value.
|
inline |
Get the wrapped performance_monitor.
Definition at line 212 of file performance_monitor_adapter.h.
References monitor_.
|
inlineoverride |
Record a simple metric value.
| name | Metric name |
| value | Metric value |
Definition at line 70 of file performance_monitor_adapter.h.
|
inlineoverride |
Record a metric with additional tags.
| name | Metric name |
| value | Metric value |
| tags | Metadata tags for the metric |
Records the metric using the underlying performance_monitor's tag-aware counter recording. Tags are preserved and passed through to enable multi-dimensional metric analysis.
Definition at line 91 of file performance_monitor_adapter.h.
References monitor_.
|
inlineoverride |
Reset all metrics in the wrapped performance_monitor.
Definition at line 197 of file performance_monitor_adapter.h.
References monitor_.
|
private |
Definition at line 217 of file performance_monitor_adapter.h.
Referenced by check_health(), get_metrics(), get_wrapped_monitor(), performance_monitor_adapter(), record_metric(), and reset().