Class stores M buckets of type Counter and allows easy calculation of percentiles.
More...
template<size_t M,
typename Counter = uint32_t, size_t ExtraBuckets = 0, size_t ExtraBucketSize = 500>
class utils::statistics::Percentile< M, Counter, ExtraBuckets, ExtraBucketSize >
Class stores M buckets of type Counter and allows easy calculation of percentiles.
Bucket X stores how many elements with value X was accounted for, for the first M buckets. Bucket X stores how many elements with values [X-ExtraBucketSize/2; X+ExtraBucketSize/2) were accounted for, for the next ExtraBuckets buckets.
- Template Parameters
-
M | how many buckets store precise value |
Counter | bucket type |
ExtraBuckets | how many buckets store approximated values |
ExtraBucketSize | ExtraBuckets store values with this precision |
- See also
- GetPercentile
-
Account
Example: Precisely count for first 500 milliseconds of execution using uint32_t counters and leave 100 buckets for all the other values with precision of 42 milliseconds:
Definition at line 56 of file percentile.hpp.