|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Utility class to aggregate metrics from multiple monitorable components. More...
#include <monitorable_interface.h>

Public Member Functions | |
| monitoring_aggregator (const std::string &id="aggregator") | |
| Constructor. | |
| void | add_component (std::shared_ptr< monitorable_interface > component) |
| Add a component to monitor. | |
| bool | remove_component (const std::string &id) |
| Remove a component by ID. | |
| common::Result< monitoring_data > | collect_all () const |
| Collect data from all components. | |
| std::shared_ptr< monitorable_interface > | get_component (const std::string &id) const |
| Get a specific component by ID. | |
| std::vector< std::string > | get_component_ids () const |
| Get all component IDs. | |
| void | clear () |
| Clear all components. | |
| std::size_t | size () const |
| Get the number of registered components. | |
Private Attributes | |
| std::vector< std::shared_ptr< monitorable_interface > > | components_ |
| std::string | aggregator_id_ |
Utility class to aggregate metrics from multiple monitorable components.
Collects and merges monitoring data from multiple components into a single aggregated view. Useful for creating dashboards or exporting combined metrics from a subsystem.
Definition at line 453 of file monitorable_interface.h.
|
inlineexplicit |
Constructor.
| id | Identifier for this aggregator |
Definition at line 463 of file monitorable_interface.h.
|
inline |
Add a component to monitor.
| component | Component to add |
Definition at line 470 of file monitorable_interface.h.
References components_.
Referenced by TEST_F(), TEST_F(), TEST_F(), and TEST_F().

|
inline |
Clear all components.
Definition at line 559 of file monitorable_interface.h.
References components_.
Referenced by TEST_F().

|
inline |
Collect data from all components.
Definition at line 498 of file monitorable_interface.h.
References kcenon::monitoring::monitoring_data::add_metric(), kcenon::monitoring::monitoring_data::add_tag(), aggregator_id_, components_, kcenon::monitoring::monitoring_data::merge(), and kcenon::monitoring::monitoring_data::metric_count().
Referenced by TEST_F(), and TEST_F().


|
inline |
Get a specific component by ID.
| id | Component ID |
Definition at line 532 of file monitorable_interface.h.
References components_.
Referenced by TEST_F().

|
inline |
Get all component IDs.
Definition at line 545 of file monitorable_interface.h.
References components_.
Referenced by TEST_F(), and TEST_F().

|
inline |
Remove a component by ID.
| id | Component ID to remove |
Definition at line 481 of file monitorable_interface.h.
References components_.
Referenced by TEST_F().

|
inline |
Get the number of registered components.
Definition at line 567 of file monitorable_interface.h.
References components_.
Referenced by TEST_F(), and TEST_F().

|
private |
Definition at line 456 of file monitorable_interface.h.
Referenced by collect_all().
|
private |
Definition at line 455 of file monitorable_interface.h.
Referenced by add_component(), clear(), collect_all(), get_component(), get_component_ids(), remove_component(), and size().