rippled
|
Basic histogram. More...
Public Member Functions | |
void | insert (T const &s) |
Insert an sample. More... | |
std::size_t | size () const |
The number of samples. More... | |
std::size_t | numBins () const |
The number of distinct samples (bins) More... | |
T | minValue () const |
Minimum observed value. More... | |
T | maxValue () const |
Maximum observed value. More... | |
T | avg () const |
Histogram average. More... | |
T | percentile (float p) const |
Calculate the given percentile of the distribution. More... | |
Private Attributes | |
std::map< T, std::size_t, Compare > | counts_ |
std::size_t | samples = 0 |
Basic histogram.
Histogram for a type T
that satisfies
Definition at line 42 of file Histogram.h.
void ripple::test::csf::Histogram< T, Compare >::insert | ( | T const & | s | ) |
Insert an sample.
Definition at line 52 of file Histogram.h.
std::size_t ripple::test::csf::Histogram< T, Compare >::size | ( | ) | const |
The number of samples.
Definition at line 60 of file Histogram.h.
std::size_t ripple::test::csf::Histogram< T, Compare >::numBins | ( | ) | const |
The number of distinct samples (bins)
Definition at line 67 of file Histogram.h.
T ripple::test::csf::Histogram< T, Compare >::minValue | ( | ) | const |
Minimum observed value.
Definition at line 74 of file Histogram.h.
T ripple::test::csf::Histogram< T, Compare >::maxValue | ( | ) | const |
Maximum observed value.
Definition at line 81 of file Histogram.h.
T ripple::test::csf::Histogram< T, Compare >::avg | ( | ) | const |
Histogram average.
Definition at line 88 of file Histogram.h.
T ripple::test::csf::Histogram< T, Compare >::percentile | ( | float | p | ) | const |
Calculate the given percentile of the distribution.
p | Percentile between 0 and 1, e.g. 0.50 is 50-th percentile If the percentile falls between two bins, uses the nearest bin. |
Definition at line 109 of file Histogram.h.
|
private |
Definition at line 46 of file Histogram.h.
|
private |
Definition at line 47 of file Histogram.h.