Sliding interval of values that provides functions to compute average, min and max values from the last window_size
values of interval.
More...
#include <userver/utils/sliding_interval.hpp>
template<
typename T>
class utils::SlidingInterval< T >
Sliding interval of values that provides functions to compute average, min and max values from the last window_size
values of interval.
It fits for small window_size
values because has O(window_size) complexity on most operations.
- See also
- utils::statistics::MinMaxAvg for a concurrent safe computation over a whole measurement interval.
Definition at line 26 of file sliding_interval.hpp.
◆ SlidingInterval()
◆ GetMaximum()
- Returns
- Maximum value in the interval
Complexity: O(window_size)
Definition at line 62 of file sliding_interval.hpp.
◆ GetMinimal()
- Returns
- Minimal value in the interval
Complexity: O(window_size)
Definition at line 55 of file sliding_interval.hpp.
◆ GetSmoothed()
- Returns
- Average value in the interval
Complexity: O(window_size)
Definition at line 46 of file sliding_interval.hpp.
◆ GetWindowSize()
- Returns
- Elements count in the interval, i.e.
window_size
passed to constructor.
Definition at line 68 of file sliding_interval.hpp.
◆ Update()
replaces the oldest value in interval with value
, i.e slides the interval.
Definition at line 35 of file sliding_interval.hpp.
The documentation for this class was generated from the following file: