|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Full-featured streaming aggregation. More...
#include <stream_aggregator.h>

Public Member Functions | |
| stream_aggregator () | |
| Default constructor. | |
| stream_aggregator (const stream_aggregator_config &config) | |
| Constructor with configuration. | |
| common::VoidResult | add_observation (double value) |
| Add an observation. | |
| streaming_statistics | get_statistics () const |
| Get full statistics. | |
| std::optional< double > | get_percentile (double p) const |
| Get specific percentile. | |
| size_t | count () const |
| Get observation count. | |
| double | mean () const |
| Get mean. | |
| double | variance () const |
| Get variance. | |
| double | stddev () const |
| Get standard deviation. | |
| void | reset () |
| Reset the aggregator. | |
Private Attributes | |
| std::shared_mutex | mutex_ |
| stream_aggregator_config | config_ |
| online_statistics | stats_ |
| std::map< double, quantile_estimator > | percentile_estimators_ |
| size_t | outlier_count_ = 0 |
| std::vector< double > | outliers_ |
Full-featured streaming aggregation.
Combines online statistics, quantile estimation, and outlier detection for comprehensive streaming metric aggregation.
Definition at line 523 of file stream_aggregator.h.
|
inline |
Default constructor.
Definition at line 528 of file stream_aggregator.h.
|
inlineexplicit |
Constructor with configuration.
| config | The configuration |
Definition at line 534 of file stream_aggregator.h.
References config_, and kcenon::monitoring::stream_aggregator_config::percentiles_to_track.
|
inline |
Add an observation.
| value | The observation value |
Definition at line 547 of file stream_aggregator.h.
References kcenon::monitoring::online_statistics::add_value(), config_, kcenon::monitoring::online_statistics::count(), kcenon::monitoring::stream_aggregator_config::enable_outlier_detection, kcenon::monitoring::online_statistics::mean(), mutex_, outlier_count_, kcenon::monitoring::stream_aggregator_config::outlier_threshold, outliers_, percentile_estimators_, stats_, and kcenon::monitoring::online_statistics::stddev().
Referenced by TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().


|
inline |
Get observation count.
Definition at line 607 of file stream_aggregator.h.
References kcenon::monitoring::online_statistics::count(), and stats_.
Referenced by TEST_F(), and TEST_F().


|
inline |
Get specific percentile.
| p | The percentile (0.0 to 1.0) |
Definition at line 595 of file stream_aggregator.h.
References mutex_, and percentile_estimators_.
Referenced by TEST_F().

|
inline |
Get full statistics.
Definition at line 576 of file stream_aggregator.h.
References kcenon::monitoring::online_statistics::get_statistics(), mutex_, kcenon::monitoring::streaming_statistics::outlier_count, outlier_count_, outliers_, percentile_estimators_, and stats_.
Referenced by TEST_F(), TEST_F(), and TEST_F().


|
inline |
Get mean.
Definition at line 614 of file stream_aggregator.h.
References kcenon::monitoring::online_statistics::mean(), and stats_.
Referenced by TEST_F().


|
inline |
Reset the aggregator.
Definition at line 635 of file stream_aggregator.h.
References mutex_, outlier_count_, outliers_, percentile_estimators_, kcenon::monitoring::online_statistics::reset(), and stats_.
Referenced by TEST_F().


|
inline |
Get standard deviation.
Definition at line 628 of file stream_aggregator.h.
References stats_, and kcenon::monitoring::online_statistics::stddev().

|
inline |
Get variance.
Definition at line 621 of file stream_aggregator.h.
References stats_, and kcenon::monitoring::online_statistics::variance().
Referenced by TEST_F().


|
private |
Definition at line 647 of file stream_aggregator.h.
Referenced by add_observation(), and stream_aggregator().
|
mutableprivate |
Definition at line 646 of file stream_aggregator.h.
Referenced by add_observation(), get_percentile(), get_statistics(), and reset().
|
private |
Definition at line 650 of file stream_aggregator.h.
Referenced by add_observation(), get_statistics(), and reset().
|
private |
Definition at line 651 of file stream_aggregator.h.
Referenced by add_observation(), get_statistics(), and reset().
|
private |
Definition at line 649 of file stream_aggregator.h.
Referenced by add_observation(), get_percentile(), get_statistics(), and reset().
|
private |
Definition at line 648 of file stream_aggregator.h.
Referenced by add_observation(), count(), get_statistics(), mean(), reset(), stddev(), and variance().