Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::performance_alert_event Class Reference

Event for performance-related alerts. More...

#include <event_types.h>

Inheritance diagram for kcenon::monitoring::performance_alert_event:
Inheritance graph
Collaboration diagram for kcenon::monitoring::performance_alert_event:
Collaboration graph

Public Types

enum class  alert_severity { info , warning , critical }
 
enum class  alert_type {
  high_cpu_usage , high_memory_usage , slow_response_time , high_error_rate ,
  resource_exhaustion , threshold_exceeded
}
 

Public Member Functions

 performance_alert_event (alert_type type, alert_severity severity, const std::string &component, const std::string &message, std::optional< double > threshold=std::nullopt, std::optional< double > actual_value=std::nullopt)
 
std::string get_type_name () const override
 Get the event type name.
 
alert_type get_alert_type () const
 
alert_severity get_severity () const
 
const std::string & get_component () const
 
const std::string & get_message () const
 
std::optional< double > get_threshold () const
 
std::optional< double > get_actual_value () const
 
- Public Member Functions inherited from kcenon::monitoring::event_base
virtual ~event_base ()=default
 
std::chrono::steady_clock::time_point get_timestamp () const
 Get timestamp when event was created.
 
uint64_t get_id () const
 Get unique event ID.
 

Private Attributes

alert_type type_
 
alert_severity severity_
 
std::string component_
 
std::string message_
 
std::optional< double > threshold_
 
std::optional< double > actual_value_
 

Additional Inherited Members

- Protected Member Functions inherited from kcenon::monitoring::event_base
 event_base ()
 

Detailed Description

Event for performance-related alerts.

Published when performance thresholds are exceeded or anomalies are detected. Includes severity, component information, and optional threshold/actual value details.

Thread Safety:
This class is thread-safe for read operations after construction. All accessors are const.
Examples
event_bus_example.cpp.

Definition at line 162 of file event_types.h.

Member Enumeration Documentation

◆ alert_severity

◆ alert_type

Constructor & Destructor Documentation

◆ performance_alert_event()

kcenon::monitoring::performance_alert_event::performance_alert_event ( alert_type type,
alert_severity severity,
const std::string & component,
const std::string & message,
std::optional< double > threshold = std::nullopt,
std::optional< double > actual_value = std::nullopt )
inline

Member Function Documentation

◆ get_actual_value()

std::optional< double > kcenon::monitoring::performance_alert_event::get_actual_value ( ) const
inline

◆ get_alert_type()

alert_type kcenon::monitoring::performance_alert_event::get_alert_type ( ) const
inline

◆ get_component()

const std::string & kcenon::monitoring::performance_alert_event::get_component ( ) const
inline

◆ get_message()

const std::string & kcenon::monitoring::performance_alert_event::get_message ( ) const
inline

◆ get_severity()

alert_severity kcenon::monitoring::performance_alert_event::get_severity ( ) const
inline

◆ get_threshold()

std::optional< double > kcenon::monitoring::performance_alert_event::get_threshold ( ) const
inline

◆ get_type_name()

std::string kcenon::monitoring::performance_alert_event::get_type_name ( ) const
inlineoverridevirtual

Get the event type name.

Returns
String representation of the event type

Implements kcenon::monitoring::event_base.

Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/core/event_types.h.

Definition at line 187 of file event_types.h.

187 {
188 return "performance_alert_event";
189 }

Member Data Documentation

◆ actual_value_

std::optional<double> kcenon::monitoring::performance_alert_event::actual_value_
private

◆ component_

std::string kcenon::monitoring::performance_alert_event::component_
private

◆ message_

std::string kcenon::monitoring::performance_alert_event::message_
private

◆ severity_

alert_severity kcenon::monitoring::performance_alert_event::severity_
private

◆ threshold_

std::optional<double> kcenon::monitoring::performance_alert_event::threshold_
private

◆ type_

alert_type kcenon::monitoring::performance_alert_event::type_
private

The documentation for this class was generated from the following file: