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

Event for component lifecycle changes. More...

#include <event_types.h>

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

Public Types

enum class  lifecycle_state {
  initializing , started , running , pausing ,
  paused , resuming , stopping , stopped ,
  error
}
 

Public Member Functions

 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.
 
const std::string & get_component () const
 
lifecycle_state get_old_state () const
 
lifecycle_state get_new_state () const
 
const std::string & get_reason () 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

std::string component_
 
lifecycle_state old_state_
 
lifecycle_state new_state_
 
std::string reason_
 

Additional Inherited Members

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

Detailed Description

Event for component lifecycle changes.

Examples
event_bus_example.cpp.

Definition at line 249 of file event_types.h.

Member Enumeration Documentation

◆ lifecycle_state

Constructor & Destructor Documentation

◆ component_lifecycle_event()

kcenon::monitoring::component_lifecycle_event::component_lifecycle_event ( const std::string & component,
lifecycle_state old_state,
lifecycle_state new_state,
const std::string & reason = "" )
inline

Member Function Documentation

◆ get_component()

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

◆ get_new_state()

lifecycle_state kcenon::monitoring::component_lifecycle_event::get_new_state ( ) const
inline

◆ get_old_state()

lifecycle_state kcenon::monitoring::component_lifecycle_event::get_old_state ( ) const
inline

◆ get_reason()

const std::string & kcenon::monitoring::component_lifecycle_event::get_reason ( ) const
inline

◆ get_type_name()

std::string kcenon::monitoring::component_lifecycle_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 270 of file event_types.h.

270 {
271 return "component_lifecycle_event";
272 }

Member Data Documentation

◆ component_

std::string kcenon::monitoring::component_lifecycle_event::component_
private

◆ new_state_

lifecycle_state kcenon::monitoring::component_lifecycle_event::new_state_
private

◆ old_state_

lifecycle_state kcenon::monitoring::component_lifecycle_event::old_state_
private

◆ reason_

std::string kcenon::monitoring::component_lifecycle_event::reason_
private

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