Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
performance_monitor_impl Class Reference
Collaboration diagram for performance_monitor_impl:
Collaboration graph

Public Member Functions

 performance_monitor_impl (const std::string &name)
 
void initialize_internal ()
 
void collect_metrics_internal ()
 
void record_metric_internal (const std::string &name, double value)
 
void check_health_internal () const
 
std::string get_name () const
 
int get_metric_count () const
 

Private Attributes

std::string name_
 
bool initialized_ = false
 
int metric_count_ = 0
 
std::unordered_map< std::string, double > metrics_
 

Detailed Description

Examples
facade_adapter_poc.cpp.

Definition at line 89 of file facade_adapter_poc.cpp.

Constructor & Destructor Documentation

◆ performance_monitor_impl()

performance_monitor_impl::performance_monitor_impl ( const std::string & name)
inlineexplicit
Examples
facade_adapter_poc.cpp.

Definition at line 91 of file facade_adapter_poc.cpp.

91: name_(name) {}

Member Function Documentation

◆ check_health_internal()

void performance_monitor_impl::check_health_internal ( ) const
inline
Examples
facade_adapter_poc.cpp.

Definition at line 109 of file facade_adapter_poc.cpp.

109 {
110 std::cout << "[Core] Health check: " << (initialized_ ? "OK" : "NOT_INITIALIZED") << std::endl;
111 }

References initialized_.

Referenced by imonitor_adapter::get_health().

Here is the caller graph for this function:

◆ collect_metrics_internal()

void performance_monitor_impl::collect_metrics_internal ( )
inline
Examples
facade_adapter_poc.cpp.

Definition at line 99 of file facade_adapter_poc.cpp.

99 {
100 std::cout << "[Core] Collecting metrics..." << std::endl;
102 }

References metric_count_.

Referenced by metrics_collector_adapter::collect_metrics().

Here is the caller graph for this function:

◆ get_metric_count()

int performance_monitor_impl::get_metric_count ( ) const
inline
Examples
facade_adapter_poc.cpp.

Definition at line 114 of file facade_adapter_poc.cpp.

114{ return metric_count_; }

References metric_count_.

Referenced by demonstrate_new_approach().

Here is the caller graph for this function:

◆ get_name()

std::string performance_monitor_impl::get_name ( ) const
inline
Examples
facade_adapter_poc.cpp.

Definition at line 113 of file facade_adapter_poc.cpp.

113{ return name_; }

References name_.

Referenced by metrics_collector_adapter::get_name().

Here is the caller graph for this function:

◆ initialize_internal()

void performance_monitor_impl::initialize_internal ( )
inline
Examples
facade_adapter_poc.cpp.

Definition at line 94 of file facade_adapter_poc.cpp.

94 {
95 std::cout << "[Core] Initializing monitor: " << name_ << std::endl;
96 initialized_ = true;
97 }

References initialized_, and name_.

Referenced by metrics_collector_adapter::initialize().

Here is the caller graph for this function:

◆ record_metric_internal()

void performance_monitor_impl::record_metric_internal ( const std::string & name,
double value )
inline
Examples
facade_adapter_poc.cpp.

Definition at line 104 of file facade_adapter_poc.cpp.

104 {
105 std::cout << "[Core] Recording metric: " << name << " = " << value << std::endl;
106 metrics_[name] = value;
107 }
std::unordered_map< std::string, double > metrics_

References metrics_.

Referenced by imonitor_adapter::record_metric().

Here is the caller graph for this function:

Member Data Documentation

◆ initialized_

bool performance_monitor_impl::initialized_ = false
private
Examples
facade_adapter_poc.cpp.

Definition at line 118 of file facade_adapter_poc.cpp.

Referenced by check_health_internal(), and initialize_internal().

◆ metric_count_

int performance_monitor_impl::metric_count_ = 0
private
Examples
facade_adapter_poc.cpp.

Definition at line 119 of file facade_adapter_poc.cpp.

Referenced by collect_metrics_internal(), and get_metric_count().

◆ metrics_

std::unordered_map<std::string, double> performance_monitor_impl::metrics_
private
Examples
facade_adapter_poc.cpp.

Definition at line 120 of file facade_adapter_poc.cpp.

Referenced by record_metric_internal().

◆ name_

std::string performance_monitor_impl::name_
private
Examples
facade_adapter_poc.cpp.

Definition at line 117 of file facade_adapter_poc.cpp.

Referenced by get_name(), and initialize_internal().


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