|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Specialized buffer for tracking load average history. More...
#include <time_series_buffer.h>

Public Member Functions | |
| load_average_history (size_t max_samples=1000) | |
| load_average_history (const load_average_history &)=delete | |
| load_average_history & | operator= (const load_average_history &)=delete |
| load_average_history (load_average_history &&)=delete | |
| load_average_history & | operator= (load_average_history &&)=delete |
| void | add_sample (double load_1m, double load_5m, double load_15m, std::chrono::system_clock::time_point timestamp=std::chrono::system_clock::now()) |
| Add a load average sample. | |
| template<typename Duration > | |
| std::vector< load_average_sample > | get_samples (Duration duration) const |
| Get samples within a duration from now. | |
| std::vector< load_average_sample > | get_samples_since (std::chrono::system_clock::time_point since) const |
| Get samples since a specific timestamp. | |
| std::vector< load_average_sample > | get_all_samples () const |
| Get all samples in chronological order. | |
| template<typename Duration > | |
| load_average_statistics | get_statistics (Duration duration) const |
| Get statistics for samples within a duration. | |
| load_average_statistics | get_statistics () const |
| Get statistics for all samples. | |
| common::Result< load_average_sample > | get_latest () const |
| Get the latest sample. | |
| size_t | size () const noexcept |
| Get current number of samples. | |
| bool | empty () const noexcept |
| Check if buffer is empty. | |
| size_t | capacity () const noexcept |
| Get buffer capacity. | |
| void | clear () noexcept |
| Clear all samples. | |
| size_t | memory_footprint () const noexcept |
| Get memory footprint in bytes. | |
Static Private Member Functions | |
| static load_average_statistics | calculate_statistics (const std::vector< load_average_sample > &samples) |
Private Attributes | |
| detail::time_series_ring_buffer< load_average_sample > | buffer_ |
Specialized buffer for tracking load average history.
This class wraps detail::time_series_ring_buffer to provide a specialized interface for load average samples with per-field statistics calculation.
Definition at line 529 of file time_series_buffer.h.
|
inlineexplicit |
Definition at line 534 of file time_series_buffer.h.
|
delete |
|
delete |
|
inline |
Add a load average sample.
| load_1m | 1-minute load average |
| load_5m | 5-minute load average |
| load_15m | 15-minute load average |
| timestamp | Optional timestamp (defaults to now) |
Definition at line 548 of file time_series_buffer.h.
References buffer_.
|
inlinestaticprivate |
Definition at line 646 of file time_series_buffer.h.
References kcenon::monitoring::detail::calculate_basic_statistics(), kcenon::monitoring::load_average_statistics::load_15m_stats, kcenon::monitoring::load_average_statistics::load_1m_stats, kcenon::monitoring::load_average_statistics::load_5m_stats, kcenon::monitoring::time_series_statistics::max_value, kcenon::monitoring::time_series_statistics::min_value, and kcenon::monitoring::time_series_statistics::sample_count.
Referenced by get_statistics(), and get_statistics().


|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Get all samples in chronological order.
Definition at line 578 of file time_series_buffer.h.
References buffer_.
Referenced by get_statistics().

|
inline |
Get the latest sample.
Definition at line 606 of file time_series_buffer.h.
References buffer_.
|
inline |
Get samples within a duration from now.
| duration | How far back to look |
Definition at line 560 of file time_series_buffer.h.
References buffer_.
Referenced by get_statistics().

|
inline |
Get samples since a specific timestamp.
| since | The timestamp to start from |
Definition at line 569 of file time_series_buffer.h.
References buffer_.
|
inline |
Get statistics for all samples.
Definition at line 597 of file time_series_buffer.h.
References calculate_statistics(), and get_all_samples().

|
inline |
Get statistics for samples within a duration.
| duration | How far back to look |
Definition at line 588 of file time_series_buffer.h.
References calculate_statistics(), and get_samples().

|
inlinenoexcept |
Get memory footprint in bytes.
Definition at line 641 of file time_series_buffer.h.
References buffer_.
|
delete |
|
delete |
|
inlinenoexcept |
Get current number of samples.
Definition at line 613 of file time_series_buffer.h.
References buffer_.
|
private |
Definition at line 531 of file time_series_buffer.h.
Referenced by add_sample(), capacity(), clear(), empty(), get_all_samples(), get_latest(), get_samples(), get_samples_since(), memory_footprint(), and size().