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

Statistics about metric collection. More...

#include <metric_types_adapter.h>

Collaboration diagram for kcenon::monitoring::metric_stats:
Collaboration graph

Public Member Functions

double success_rate () const
 
void reset ()
 

Public Attributes

uint64_t total_collected {0}
 
uint64_t total_errors {0}
 
uint64_t total_dropped {0}
 
std::chrono::milliseconds avg_collection_time {0}
 
std::chrono::system_clock::time_point last_collection
 

Detailed Description

Statistics about metric collection.

Tracks collection performance metrics including success/error counts, dropped metrics, and timing information. Useful for monitoring the health of the collection system itself.

Thread Safety:
This struct is NOT thread-safe. Use atomic counters or external synchronization for concurrent updates.

Definition at line 117 of file metric_types_adapter.h.

Member Function Documentation

◆ reset()

◆ success_rate()

double kcenon::monitoring::metric_stats::success_rate ( ) const
inline
Examples
/home/runner/work/monitoring_system/monitoring_system/include/kcenon/monitoring/interfaces/metric_types_adapter.h.

Definition at line 124 of file metric_types_adapter.h.

124 {
125 if (total_collected == 0) return 0.0;
126 return 1.0 - (static_cast<double>(total_errors) / total_collected);
127 }

References total_collected, and total_errors.

Member Data Documentation

◆ avg_collection_time

std::chrono::milliseconds kcenon::monitoring::metric_stats::avg_collection_time {0}

◆ last_collection

std::chrono::system_clock::time_point kcenon::monitoring::metric_stats::last_collection

◆ total_collected

uint64_t kcenon::monitoring::metric_stats::total_collected {0}

◆ total_dropped

uint64_t kcenon::monitoring::metric_stats::total_dropped {0}

◆ total_errors

uint64_t kcenon::monitoring::metric_stats::total_errors {0}

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