|
Squid Web Cache master
|
#include <StatHist.h>
Public Types | |
| typedef uint64_t | bins_type |
Public Member Functions | |
| StatHist ()=default | |
| StatHist (const StatHist &) | |
| ~StatHist () | |
| StatHist & | operator= (const StatHist &) |
| 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 | |
| unsigned int | capacity_ = 0 |
| double | min_ = 0.0 |
| minimum value to be stored, corresponding to the first bin | |
| double | max_ = 0.0 |
| value of the maximum counter in the histogram | |
| double | scale_ = 1.0 |
| scaling factor when looking for a bin | |
| hbase_f * | val_in = nullptr |
| hbase_f * | val_out = nullptr |
Generic histogram class
see important comments on hbase_f restrictions in StatHist.cc
Definition at line 25 of file StatHist.h.
| typedef uint64_t StatHist::bins_type |
Definition at line 44 of file StatHist.h.
|
default |
| StatHist::StatHist | ( | const StatHist & | src | ) |
Definition at line 39 of file StatHist.cc.
|
inline |
Definition at line 39 of file StatHist.h.
| void StatHist::count | ( | double | val | ) |
increment the counter for the histogram entry associated to the supplied value
Definition at line 55 of file StatHist.cc.
References bins, and findBin().
Referenced by CacheDigest::add(), clientUpdateHierCounters(), clientUpdateStatHistCounters(), Comm::DoSelect(), Comm::Incoming::finishPolling(), fqdncacheHandleReply(), httpHdrCcUpdateStats(), icpCount(), ipcacheHandleReply(), recordMemBlobSizeAtDestruct(), recordSBufSizeAtDestruct(), TestStatHist::testStatHistBaseAssignment(), TestStatHist::testStatHistBaseEquality(), TestStatHist::testStatHistLog(), TestStatHist::testStatHistSum(), and HttpHdrScTarget::updateStats().
| void StatHist::dump | ( | StoreEntry * | sentry, |
| StatHistBinDumper * | bd | ||
| ) | const |
iterate the supplied bd function over the histogram values
Definition at line 171 of file StatHist.cc.
References assert, bins, capacity_, min_, statHistBinDumper, and val().
Referenced by commIncomingStats(), commIncomingStats(), commIncomingStats(), commIncomingStats(), SBufStatsAction::dump(), httpHeaderStatDump(), and statCountersHistograms().
| void StatHist::enumInit | ( | unsigned int | last_enum | ) |
initialize the histogram to count occurrences in an enum-represented set
Definition at line 235 of file StatHist.cc.
References init(), and Math::Null.
Referenced by HttpHeaderStat::HttpHeaderStat(), HttpHeaderStat::HttpHeaderStat(), Comm::Incoming::init(), statCountersInitSpecial(), TestStatHist::testStatHistBaseAssignment(), and TestStatHist::testStatHistBaseEquality().
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 capacity_, min_, scale_, and val_in.
Referenced by count(), and InspectingStatHist::counter().
|
protected |
low-level initialize function. called by *Init high-level functions
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, bins, capacity_, max_, min_, scale_, val_in, val_out, and xcalloc().
Referenced by enumInit(), and logInit().
Initialize the Histogram using a logarithmic values distribution
Definition at line 221 of file StatHist.cc.
References Math::Exp, init(), Math::Log, max(), and min().
Referenced by makeDestructTimeHist(), statCountersInitSpecial(), TestStatHist::testStatHistLog(), and TestStatHist::testStatHistSum().
obtain the output-transformed value from the specified bin
Definition at line 85 of file StatHist.cc.
References min_, scale_, and val_out.
Referenced by deltaPctile(), and dump().
|
protected |
Definition at line 101 of file StatHist.h.
Referenced by StatHist(), ~StatHist(), count(), InspectingStatHist::counter(), deltaPctile(), dump(), init(), operator+=(), operator=(), and InspectingStatHist::operator==().
|
protected |
Definition at line 102 of file StatHist.h.
Referenced by StatHist(), ~StatHist(), deltaPctile(), dump(), findBin(), init(), operator+=(), operator=(), and InspectingStatHist::operator==().
|
protected |
Definition at line 108 of file StatHist.h.
Referenced by init(), operator+=(), operator=(), and InspectingStatHist::operator==().
|
protected |
Definition at line 105 of file StatHist.h.
Referenced by dump(), findBin(), init(), operator+=(), operator=(), InspectingStatHist::operator==(), and val().
|
protected |
Definition at line 111 of file StatHist.h.
Referenced by findBin(), init(), operator=(), InspectingStatHist::operator==(), and val().
|
protected |
Definition at line 112 of file StatHist.h.
Referenced by findBin(), init(), operator=(), and InspectingStatHist::operator==().
|
protected |
Definition at line 113 of file StatHist.h.
Referenced by init(), operator=(), InspectingStatHist::operator==(), and val().