|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Complete snapshot of metrics at a point in time. More...
#include <monitoring_core.h>

Public Member Functions | |
| metrics_snapshot () | |
| void | add_metric (const std::string &name, double value) |
| Add a metric to the snapshot. | |
| void | add_metric (const std::string &name, double value, const std::unordered_map< std::string, std::string > &tags) |
| Add a metric to the snapshot with tags. | |
| std::optional< double > | get_metric (const std::string &name) const |
| Get a specific metric value. | |
Public Attributes | |
| std::vector< metric_value > | metrics |
| std::chrono::system_clock::time_point | capture_time |
| std::string | source_id |
Complete snapshot of metrics at a point in time.
Definition at line 64 of file monitoring_core.h.
|
inline |
Definition at line 69 of file monitoring_core.h.
|
inline |
Add a metric to the snapshot.
| name | Metric name |
| value | Metric value |
Definition at line 77 of file monitoring_core.h.
References metrics.
Referenced by mock_collector::collect(), MetricExportersTest::create_test_snapshot(), StorageBackendsTest::create_test_snapshots(), console_logger::get_monitoring_data(), main(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().

|
inline |
Add a metric to the snapshot with tags.
| name | Metric name |
| value | Metric value |
| tags | Metadata tags for the metric |
Definition at line 87 of file monitoring_core.h.
References metrics, and kcenon::monitoring::metric_value::tags.
|
inline |
Get a specific metric value.
| name | Metric name |
Definition at line 99 of file monitoring_core.h.
References metrics.
Referenced by main(), and TEST_F().

| std::chrono::system_clock::time_point kcenon::monitoring::metrics_snapshot::capture_time |
Definition at line 66 of file monitoring_core.h.
Referenced by mock_collector::collect(), MetricExportersTest::create_test_snapshot(), StorageBackendsTest::create_test_snapshots(), and aggregating_monitor::get_metrics().
| std::vector<metric_value> kcenon::monitoring::metrics_snapshot::metrics |
Definition at line 65 of file monitoring_core.h.
Referenced by add_metric(), add_metric(), kcenon::monitoring::opentelemetry_metrics_adapter::convert_metrics(), kcenon::monitoring::prometheus_exporter::convert_snapshot(), kcenon::monitoring::statsd_exporter::convert_snapshot(), MetricExportersTest::create_test_snapshot(), get_metric(), aggregating_monitor::get_metrics(), main(), and TEST_F().
| std::string kcenon::monitoring::metrics_snapshot::source_id |
Definition at line 67 of file monitoring_core.h.
Referenced by mock_collector::collect(), kcenon::monitoring::prometheus_exporter::convert_snapshot(), kcenon::monitoring::statsd_exporter::convert_snapshot(), MetricExportersTest::create_test_snapshot(), StorageBackendsTest::create_test_snapshots(), aggregating_monitor::get_metrics(), console_logger::get_monitoring_data(), TEST(), TEST_F(), and TEST_F().