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

Lightweight performance profile for aggregated metrics. More...

#include <performance_types.h>

Collaboration diagram for kcenon::monitoring::performance_profile:
Collaboration graph

Public Member Functions

double success_rate () const
 Calculate success rate.
 
double error_rate () const
 Calculate error rate.
 

Public Attributes

std::string operation_name
 
std::uint64_t total_calls {0}
 
std::uint64_t error_count {0}
 
std::int64_t total_duration_ns {0}
 
std::int64_t min_duration_ns {INT64_MAX}
 
std::int64_t max_duration_ns {0}
 
std::int64_t avg_duration_ns {0}
 

Detailed Description

Lightweight performance profile for aggregated metrics.

This is a simplified profile structure used by the central collector for efficient metric aggregation. For detailed percentile analysis, use performance_metrics.

Definition at line 25 of file performance_types.h.

Member Function Documentation

◆ error_rate()

double kcenon::monitoring::performance_profile::error_rate ( ) const
inline

Calculate error rate.

Returns
Error rate as percentage (0-100)

Definition at line 51 of file performance_types.h.

51 {
52 if (total_calls == 0) return 0.0;
53 return 100.0 * error_count / total_calls;
54 }

References error_count, and total_calls.

◆ success_rate()

double kcenon::monitoring::performance_profile::success_rate ( ) const
inline

Calculate success rate.

Returns
Success rate as percentage (0-100)

Definition at line 42 of file performance_types.h.

42 {
43 if (total_calls == 0) return 100.0;
44 return 100.0 * (total_calls - error_count) / total_calls;
45 }

References error_count, and total_calls.

Member Data Documentation

◆ avg_duration_ns

std::int64_t kcenon::monitoring::performance_profile::avg_duration_ns {0}

Definition at line 36 of file performance_types.h.

36{0};

◆ error_count

std::uint64_t kcenon::monitoring::performance_profile::error_count {0}

Definition at line 30 of file performance_types.h.

30{0};

Referenced by error_rate(), and success_rate().

◆ max_duration_ns

std::int64_t kcenon::monitoring::performance_profile::max_duration_ns {0}

Definition at line 35 of file performance_types.h.

35{0};

◆ min_duration_ns

std::int64_t kcenon::monitoring::performance_profile::min_duration_ns {INT64_MAX}

Definition at line 34 of file performance_types.h.

34{INT64_MAX};

◆ operation_name

std::string kcenon::monitoring::performance_profile::operation_name

Definition at line 26 of file performance_types.h.

◆ total_calls

std::uint64_t kcenon::monitoring::performance_profile::total_calls {0}

Definition at line 29 of file performance_types.h.

29{0};

Referenced by error_rate(), and success_rate().

◆ total_duration_ns

std::int64_t kcenon::monitoring::performance_profile::total_duration_ns {0}

Definition at line 33 of file performance_types.h.

33{0};

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