|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Performance profiler for code sections. More...
#include <performance_monitor.h>

Classes | |
| struct | profile_data |
Public Member Functions | |
| common::Result< bool > | record_sample (const std::string &operation_name, std::chrono::nanoseconds duration, bool success=true) |
| Record a performance sample. | |
| common::Result< performance_metrics > | get_metrics (const std::string &operation_name) const |
| Get performance metrics for an operation. | |
| std::vector< performance_metrics > | get_all_metrics () const |
| Get all performance metrics. | |
| common::Result< bool > | clear_samples (const std::string &operation_name) |
| Clear samples for an operation. | |
| void | clear_all_samples () |
| Clear all samples. | |
| void | set_enabled (bool enabled) |
| Enable or disable profiling. | |
| bool | is_enabled () const |
| Check if profiling is enabled. | |
| void | set_max_samples (std::size_t max_samples) |
| Set maximum samples per operation. | |
| void | set_lock_free_mode (bool enable) |
| Enable lock-free collection path (Sprint 3-4) | |
| bool | is_lock_free_mode () const |
| Check if lock-free mode is enabled. | |
Private Attributes | |
| std::unordered_map< std::string, std::unique_ptr< profile_data > > | profiles_ |
| std::shared_mutex | profiles_mutex_ |
| std::atomic< bool > | enabled_ {true} |
| std::size_t | max_samples_per_operation_ {10000} |
| std::size_t | max_profiles_ {10000} |
| std::atomic< bool > | use_lock_free_path_ {false} |
Performance profiler for code sections.
Definition at line 137 of file performance_monitor.h.
| void kcenon::monitoring::performance_profiler::clear_all_samples | ( | ) |
Clear all samples.
Referenced by kcenon::monitoring::performance_monitor::reset(), and PerformanceMonitoringTest::SetUp().

| common::Result< bool > kcenon::monitoring::performance_profiler::clear_samples | ( | const std::string & | operation_name | ) |
Clear samples for an operation.
| std::vector< performance_metrics > kcenon::monitoring::performance_profiler::get_all_metrics | ( | ) | const |
Get all performance metrics.
| common::Result< performance_metrics > kcenon::monitoring::performance_profiler::get_metrics | ( | const std::string & | operation_name | ) | const |
Get performance metrics for an operation.
Referenced by kcenon::monitoring::performance_benchmark::run().

|
inline |
Check if profiling is enabled.
Definition at line 201 of file performance_monitor.h.
References enabled_.
|
inline |
Check if lock-free mode is enabled.
Definition at line 228 of file performance_monitor.h.
References use_lock_free_path_.
| common::Result< bool > kcenon::monitoring::performance_profiler::record_sample | ( | const std::string & | operation_name, |
| std::chrono::nanoseconds | duration, | ||
| bool | success = true ) |
Record a performance sample.
Referenced by kcenon::monitoring::scoped_timer::complete(), and kcenon::monitoring::performance_benchmark::run().

|
inline |
Enable or disable profiling.
| enabled | True to enable profiling, false to disable |
Definition at line 195 of file performance_monitor.h.
References enabled_.
Referenced by kcenon::monitoring::performance_monitor::set_enabled().

|
inline |
Enable lock-free collection path (Sprint 3-4)
When enabled, uses thread-local buffers for lock-free metric collection. This provides significantly better performance under high concurrency.
| enable | true to enable lock-free path, false for legacy path |
Definition at line 220 of file performance_monitor.h.
References use_lock_free_path_.
|
inline |
Set maximum samples per operation.
| max_samples | Maximum number of samples to retain per operation |
Definition at line 207 of file performance_monitor.h.
References max_samples_per_operation_.
|
private |
Definition at line 152 of file performance_monitor.h.
Referenced by is_enabled(), and set_enabled().
|
private |
Definition at line 154 of file performance_monitor.h.
|
private |
|
private |
Definition at line 150 of file performance_monitor.h.
|
mutableprivate |
Definition at line 151 of file performance_monitor.h.
|
private |
Definition at line 157 of file performance_monitor.h.
Referenced by is_lock_free_mode(), and set_lock_free_mode().