|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
P² algorithm for streaming quantile estimation. More...
#include <stream_aggregator.h>

Public Member Functions | |
| quantile_estimator (double p) | |
| Constructor. | |
| quantile_estimator (quantile_estimator &&other) noexcept | |
| quantile_estimator & | operator= (quantile_estimator &&other) noexcept |
| quantile_estimator (const quantile_estimator &)=delete | |
| quantile_estimator & | operator= (const quantile_estimator &)=delete |
| void | add_observation (double x) |
| Add an observation. | |
| double | get_quantile () const |
| Get the estimated quantile. | |
| size_t | count () const |
| Get observation count. | |
| void | reset () |
| Reset the estimator. | |
Private Member Functions | |
| void | init_markers () |
| double | parabolic (int i, int sign) const |
| double | linear (int i, int sign) const |
Private Attributes | |
| std::shared_mutex | mutex_ |
| double | p_ |
| size_t | count_ = 0 |
| double | q_ [5] = {0} |
| int | n_ [5] = {0} |
| double | n_prime_ [5] = {0} |
| double | dn_ [5] = {0} |
P² algorithm for streaming quantile estimation.
Implements the P² algorithm for estimating quantiles without storing all observations. Uses piecewise-parabolic interpolation.
Definition at line 193 of file stream_aggregator.h.
|
inlineexplicit |
Constructor.
| p | The quantile to estimate (0.0 to 1.0) |
Definition at line 199 of file stream_aggregator.h.
References init_markers().

|
inlinenoexcept |
Definition at line 204 of file stream_aggregator.h.
References dn_, n_, n_prime_, kcenon::monitoring::other, and q_.
|
delete |
|
inline |
Add an observation.
| x | The observation value |
Definition at line 259 of file stream_aggregator.h.
References count_, dn_, linear(), mutex_, n_, n_prime_, parabolic(), and q_.
Referenced by TEST_F(), and TEST_F().


|
inline |
|
inline |
Get the estimated quantile.
Definition at line 319 of file stream_aggregator.h.
References count_, mutex_, p_, and q_.
Referenced by TEST_F(), and TEST_F().

|
inlineprivate |
Definition at line 230 of file stream_aggregator.h.
References dn_, n_, n_prime_, and p_.
Referenced by quantile_estimator().

|
inlineprivate |
Definition at line 372 of file stream_aggregator.h.
Referenced by add_observation().

|
delete |
|
inlinenoexcept |
Definition at line 213 of file stream_aggregator.h.
References count_, dn_, n_, n_prime_, kcenon::monitoring::other, p_, and q_.
|
inlineprivate |
Definition at line 357 of file stream_aggregator.h.
Referenced by add_observation().

|
inline |
|
private |
Definition at line 380 of file stream_aggregator.h.
Referenced by add_observation(), count(), get_quantile(), operator=(), and reset().
|
private |
Definition at line 384 of file stream_aggregator.h.
Referenced by add_observation(), init_markers(), operator=(), and quantile_estimator().
|
mutableprivate |
Definition at line 378 of file stream_aggregator.h.
Referenced by add_observation(), count(), get_quantile(), and reset().
|
private |
Definition at line 382 of file stream_aggregator.h.
Referenced by add_observation(), init_markers(), linear(), operator=(), parabolic(), quantile_estimator(), and reset().
|
private |
Definition at line 383 of file stream_aggregator.h.
Referenced by add_observation(), init_markers(), operator=(), quantile_estimator(), and reset().
|
private |
Definition at line 379 of file stream_aggregator.h.
Referenced by get_quantile(), init_markers(), operator=(), and reset().
|
private |
Definition at line 381 of file stream_aggregator.h.
Referenced by add_observation(), get_quantile(), linear(), operator=(), parabolic(), and quantile_estimator().