Public Types | |
typedef uint64_t | bins_type |
Public Member Functions | |
bool | operator== (const InspectingStatHist &) |
bins_type | counter (double v) |
double | deltaPctile (const StatHist &B, double pctile) const |
double | val (unsigned int bin) const |
void | count (double val) |
void | dump (StoreEntry *sentry, StatHistBinDumper *bd) const |
void | logInit (unsigned int capacity, double min, double max) |
void | enumInit (unsigned int last_enum) |
StatHist & | operator+= (const StatHist &B) |
Protected Member Functions | |
void | init (unsigned int capacity, hbase_f *val_in, hbase_f *val_out, double min, double max) |
unsigned int | findBin (double v) |
Protected Attributes | |
bins_type * | bins = nullptr |
the histogram counters More... | |
unsigned int | capacity_ = 0 |
double | min_ = 0.0 |
minimum value to be stored, corresponding to the first bin More... | |
double | max_ = 0.0 |
value of the maximum counter in the histogram More... | |
double | scale_ = 1.0 |
scaling factor when looking for a bin More... | |
hbase_f * | val_in = nullptr |
hbase_f * | val_out = nullptr |
Detailed Description
Definition at line 36 of file testStatHist.cc.
Member Typedef Documentation
◆ bins_type
|
inherited |
Definition at line 44 of file StatHist.h.
Member Function Documentation
◆ count()
|
inherited |
increment the counter for the histogram entry associated to the supplied value
Definition at line 55 of file StatHist.cc.
References StatHist::bins, and StatHist::findBin().
Referenced by CacheDigest::add(), clientUpdateHierCounters(), clientUpdateStatHistCounters(), comm_poll_dns_incoming(), comm_poll_tcp_incoming(), comm_poll_udp_incoming(), comm_select_dns_incoming(), comm_select_tcp_incoming(), comm_select_udp_incoming(), Comm::DoSelect(), fqdncacheHandleReply(), httpHdrCcUpdateStats(), icpCount(), ipcacheHandleReply(), recordMemBlobSizeAtDestruct(), recordSBufSizeAtDestruct(), TestStatHist::testStatHistBaseAssignment(), TestStatHist::testStatHistBaseEquality(), TestStatHist::testStatHistLog(), TestStatHist::testStatHistSum(), and HttpHdrScTarget::updateStats().
◆ counter()
Definition at line 40 of file testStatHist.cc.
References StatHist::bins, and StatHist::findBin().
Referenced by TestStatHist::testStatHistLog().
◆ deltaPctile()
Calculate the percentile for value pctile for the difference between this and the supplied histogram.
Definition at line 103 of file StatHist.cc.
References assert, B, StatHist::bins, StatHist::capacity_, D, int, s1, StatHist::val(), xcalloc(), and xfree.
◆ dump()
|
inherited |
iterate the supplied bd function over the histogram values
Definition at line 171 of file StatHist.cc.
References assert, StatHist::bins, StatHist::capacity_, StatHist::min_, statHistBinDumper, and StatHist::val().
Referenced by commIncomingStats(), SBufStatsAction::dump(), httpHeaderStatDump(), and statCountersHistograms().
◆ enumInit()
|
inherited |
initialize the histogram to count occurrences in an enum-represented set
Definition at line 235 of file StatHist.cc.
References StatHist::init(), and Math::Null.
Referenced by HttpHeaderStat::HttpHeaderStat(), TestStatHist::testStatHistBaseAssignment(), and TestStatHist::testStatHistBaseEquality().
◆ findBin()
find what entry in the histogram corresponds to v, by applying the preset input transformation function
Definition at line 64 of file StatHist.cc.
References StatHist::capacity_, StatHist::min_, StatHist::scale_, and StatHist::val_in.
Referenced by StatHist::count(), and counter().
◆ init()
|
protectedinherited |
low-level initialize function. called by *Init high-level functions
- Note
- Important restrictions on val_in and val_out functions:
- val_in: ascending, defined on [0, oo), val_in(0) == 0;
- val_out: x == val_out(val_in(x)) where val_in(x) is defined
In practice, the requirements are less strict, but then it gets hard to define them without math notation. val_in is applied after offsetting the value but before scaling See log and linear based histograms for examples
Definition at line 26 of file StatHist.cc.
References assert, StatHist::bins, StatHist::capacity_, StatHist::max_, StatHist::min_, StatHist::scale_, StatHist::val_in, StatHist::val_out, and xcalloc().
Referenced by StatHist::enumInit(), and StatHist::logInit().
◆ logInit()
Initialize the Histogram using a logarithmic values distribution
Definition at line 221 of file StatHist.cc.
References Math::Exp, StatHist::init(), Math::Log, max(), and min().
Referenced by TestStatHist::testStatHistLog(), and TestStatHist::testStatHistSum().
◆ operator+=()
Import values from another histogram
- Note
- : the two histograms MUST have the same capicity, min and max or an exception will be raised
Definition at line 187 of file StatHist.cc.
References B, StatHist::bins, StatHist::capacity_, StatHist::max_, StatHist::min_, and Must.
◆ operator==()
bool InspectingStatHist::operator== | ( | const InspectingStatHist & | src | ) |
Definition at line 46 of file testStatHist.cc.
References assert, StatHist::bins, StatHist::capacity_, StatHist::max_, StatHist::min_, StatHist::scale_, StatHist::val_in, and StatHist::val_out.
◆ val()
obtain the output-transformed value from the specified bin
Definition at line 85 of file StatHist.cc.
References StatHist::min_, StatHist::scale_, and StatHist::val_out.
Referenced by StatHist::deltaPctile(), and StatHist::dump().
Member Data Documentation
◆ bins
|
protectedinherited |
Definition at line 101 of file StatHist.h.
Referenced by StatHist::StatHist(), StatHist::~StatHist(), StatHist::count(), counter(), StatHist::deltaPctile(), StatHist::dump(), StatHist::init(), StatHist::operator+=(), StatHist::operator=(), and operator==().
◆ capacity_
|
protectedinherited |
Definition at line 102 of file StatHist.h.
Referenced by StatHist::StatHist(), StatHist::~StatHist(), StatHist::deltaPctile(), StatHist::dump(), StatHist::findBin(), StatHist::init(), StatHist::operator+=(), StatHist::operator=(), and operator==().
◆ max_
|
protectedinherited |
Definition at line 108 of file StatHist.h.
Referenced by StatHist::init(), StatHist::operator+=(), StatHist::operator=(), and operator==().
◆ min_
|
protectedinherited |
Definition at line 105 of file StatHist.h.
Referenced by StatHist::dump(), StatHist::findBin(), StatHist::init(), StatHist::operator+=(), StatHist::operator=(), operator==(), and StatHist::val().
◆ scale_
|
protectedinherited |
Definition at line 111 of file StatHist.h.
Referenced by StatHist::findBin(), StatHist::init(), StatHist::operator=(), operator==(), and StatHist::val().
◆ val_in
|
protectedinherited |
Definition at line 112 of file StatHist.h.
Referenced by StatHist::findBin(), StatHist::init(), StatHist::operator=(), and operator==().
◆ val_out
|
protectedinherited |
Definition at line 113 of file StatHist.h.
Referenced by StatHist::init(), StatHist::operator=(), operator==(), and StatHist::val().
The documentation for this class was generated from the following file:
- src/tests/testStatHist.cc