template<typename Counter, typename Result, typename Timer = utils::datetime::SteadyClock>
class utils::statistics::RecentPeriod< Counter, Result, Timer >
Class maintains circular buffer of Counters.
At any time current Counter is accessible for modification via GetCurrentCounter(). Counter can provide a Reset() member function or an ADL-found ResetMetric function to clear contents.
- See also
- utils::statistics::Percentile
Definition at line 29 of file recentperiod.hpp.
template<typename Counter, typename Result, typename Timer = utils::datetime::SteadyClock>
| const Result utils::statistics::RecentPeriod< Counter, Result, Timer >::GetStatsForPeriod |
( |
Duration | duration = Duration::min(), |
|
|
bool | with_current_epoch = false ) const |
|
inline |
Aggregates counters within given time range.
- Parameters
-
| duration | Time range. Special value Duration::min() -> use whole RecentPeriod range. |
| with_current_epoch | Include current (possibly unfinished) counter into aggregation |
Type Result must have method Add(Counter, Duration, Duration) or allow addition of counter values
Definition at line 70 of file recentperiod.hpp.