|
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>


Classes | |
| struct | validated_tag |
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. | |
Static Public Member Functions | |
| static common::Result< std::shared_ptr< performance_monitor_adapter > > | create (std::shared_ptr< performance_monitor > monitor) |
| Create an adapter with validated monitor pointer. | |
Private Member Functions | |
| performance_monitor_adapter (std::shared_ptr< performance_monitor > monitor, validated_tag) | |
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 71 of file performance_monitor_adapter.h.
References monitor_.
Referenced by create().

|
inlineprivate |
Definition at line 239 of file performance_monitor_adapter.h.
|
inlineoverride |
Perform health check on the performance_monitor.
Definition at line 188 of file performance_monitor_adapter.h.
References monitor_.
|
inlinestatic |
Create an adapter with validated monitor pointer.
| monitor | Shared pointer to the performance_monitor to wrap |
Definition at line 52 of file performance_monitor_adapter.h.
References kcenon::monitoring::invalid_configuration, and performance_monitor_adapter().
Referenced by kcenon::monitoring::make_monitor_adapter(), TEST(), and TEST().


|
inlineoverride |
Get current metrics snapshot.
Definition at line 131 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 231 of file performance_monitor_adapter.h.
References monitor_.
|
inlineoverride |
Record a simple metric value.
| name | Metric name |
| value | Metric value |
Definition at line 89 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 110 of file performance_monitor_adapter.h.
References monitor_.
|
inlineoverride |
Reset all metrics in the wrapped performance_monitor.
Definition at line 216 of file performance_monitor_adapter.h.
References monitor_.
|
private |
Definition at line 242 of file performance_monitor_adapter.h.
Referenced by check_health(), get_metrics(), get_wrapped_monitor(), performance_monitor_adapter(), record_metric(), and reset().