19#include <unordered_map>
25namespace kcenon {
namespace monitoring {
64 return "thread_pool_metric_event";
95 return "logging_metric_event";
128 return "system_resource_event";
180 const std::string& component,
181 const std::string& message,
182 std::optional<double> threshold = std::nullopt,
183 std::optional<double> actual_value = std::nullopt)
188 return "performance_alert_event";
220 const std::string& config_key,
222 const std::string& old_value =
"",
223 const std::string& new_value =
"")
228 return "configuration_change_event";
266 const std::string& reason =
"")
271 return "component_lifecycle_event";
293 std::vector<metric> metrics)
297 return "metric_collection_event";
327 std::optional<std::unordered_map<std::string, std::string>>
metadata;
331 std::vector<health_check_result> results)
335 return "health_check_event";
343 for (
const auto& result :
results_) {
Event for component lifecycle changes.
const std::string & get_reason() const
lifecycle_state get_new_state() const
const std::string & get_component() const
lifecycle_state old_state_
lifecycle_state new_state_
lifecycle_state get_old_state() const
component_lifecycle_event(const std::string &component, lifecycle_state old_state, lifecycle_state new_state, const std::string &reason="")
std::string get_type_name() const override
Get the event type name.
Event fired when configuration changes.
const std::string & get_config_key() const
std::string get_type_name() const override
Get the event type name.
configuration_change_event(const std::string &component, const std::string &config_key, change_type type, const std::string &old_value="", const std::string &new_value="")
const std::string & get_new_value() const
const std::string & get_component() const
const std::string & get_old_value() const
change_type get_change_type() const
Base class for all events in the system.
Event for health check results.
health_status get_overall_status() const
std::string get_type_name() const override
Get the event type name.
const std::string & get_component() const
std::vector< health_check_result > results_
const std::vector< health_check_result > & get_results() const
health_check_event(const std::string &component, std::vector< health_check_result > results)
Event containing logging system metrics.
std::string get_type_name() const override
Get the event type name.
const logging_stats & get_stats() const
logging_metric_event(const std::string &logger_name, const logging_stats &stats)
const std::string & get_logger_name() const
Event containing collected metrics batch.
size_t get_metric_count() const
const std::vector< metric > & get_metrics() const
std::vector< metric > metrics_
std::string collector_name_
const std::string & get_collector_name() const
metric_collection_event(const std::string &collector_name, std::vector< metric > metrics)
std::string get_type_name() const override
Get the event type name.
Event containing system resource metrics.
std::string get_type_name() const override
Get the event type name.
system_resource_event(const resource_stats &stats)
const resource_stats & get_stats() const
Event containing thread pool metrics.
const thread_pool_stats & get_stats() const
std::string get_type_name() const override
Get the event type name.
const std::string & get_pool_name() const
thread_pool_metric_event(const std::string &pool_name, const thread_pool_stats &stats)
Event bus interface for decoupled component communication.
Adapter for metric types to support interface definitions.
std::chrono::milliseconds response_time
std::optional< std::unordered_map< std::string, std::string > > metadata
size_t buffer_usage_bytes
uint64_t memory_used_bytes
uint64_t memory_total_bytes
uint64_t disk_total_bytes
uint64_t network_tx_bytes
uint64_t network_rx_bytes
std::chrono::milliseconds avg_task_duration