Inheritance diagram for InspectingStatHist:
Collaboration diagram for InspectingStatHist:

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)
 
StatHistoperator+= (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_typebins = 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_fval_in = nullptr
 
hbase_fval_out = nullptr
 

Detailed Description

Definition at line 20 of file testStatHist.cc.

Member Typedef Documentation

◆ bins_type

typedef uint64_t StatHist::bins_type
inherited

Definition at line 44 of file StatHist.h.

Member Function Documentation

◆ count()

◆ counter()

bins_type InspectingStatHist::counter ( double  v)
inline

Definition at line 24 of file testStatHist.cc.

References StatHist::bins, and StatHist::findBin().

Referenced by testStatHist::testStatHistLog().

◆ deltaPctile()

double StatHist::deltaPctile ( const StatHist B,
double  pctile 
) const
inherited

Calculate the percentile for value pctile for the difference between this and the supplied histogram.

Definition at line 105 of file StatHist.cc.

References a, assert, StatHist::bins, StatHist::capacity_, D, i, int, s1, StatHist::val(), xcalloc, and xfree.

Referenced by statHistDeltaPctile().

◆ dump()

void StatHist::dump ( StoreEntry sentry,
StatHistBinDumper bd 
) const
inherited

iterate the supplied bd function over the histogram values

Definition at line 173 of file StatHist.cc.

References assert, StatHist::bins, StatHist::capacity_, i, StatHist::min_, statHistBinDumper, and StatHist::val().

Referenced by commIncomingStats(), SBufStatsAction::dump(), httpHeaderStatDump(), and statCountersHistograms().

◆ enumInit()

void StatHist::enumInit ( unsigned int  last_enum)
inherited

initialize the histogram to count occurrences in an enum-represented set

Definition at line 237 of file StatHist.cc.

References StatHist::init(), and Math::Null.

Referenced by HttpHeaderStat::HttpHeaderStat(), statCountersInitSpecial(), testStatHist::testStatHistBaseAssignment(), and testStatHist::testStatHistBaseEquality().

◆ findBin()

unsigned int StatHist::findBin ( double  v)
protectedinherited

find what entry in the histogram corresponds to v, by applying the preset input transformation function

Definition at line 66 of file StatHist.cc.

References StatHist::capacity_, StatHist::min_, StatHist::scale_, and StatHist::val_in.

Referenced by StatHist::count(), and counter().

◆ init()

void StatHist::init ( unsigned int  capacity,
hbase_f val_in,
hbase_f val_out,
double  min,
double  max 
)
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 offseting the value but before scaling See log and linear based histograms for examples

Definition at line 28 of file StatHist.cc.

References assert, and xcalloc.

Referenced by StatHist::enumInit(), and StatHist::logInit().

◆ logInit()

void StatHist::logInit ( unsigned int  capacity,
double  min,
double  max 
)
inherited

Initialize the Histogram using a logarithmic values distribution

Definition at line 223 of file StatHist.cc.

References Math::Exp, StatHist::init(), Math::Log, and Math::Null.

Referenced by newStatHist(), statCountersInitSpecial(), testStatHist::testStatHistLog(), and testStatHist::testStatHistSum().

◆ operator+=()

StatHist & StatHist::operator+= ( const StatHist B)
inherited

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 189 of file StatHist.cc.

References assert, B, StatHist::bins, StatHist::capacity_, Math::Exp, i, Math::Log, log(), StatHist::max_, StatHist::min_, Must, and NULL.

◆ operator==()

bool InspectingStatHist::operator== ( const InspectingStatHist src)

◆ val()

double StatHist::val ( unsigned int  bin) const
inherited

obtain the output-transformed value from the specified bin

Definition at line 87 of file StatHist.cc.

References StatHist::min_, StatHist::scale_, and StatHist::val_out.

Referenced by StatHist::deltaPctile(), and StatHist::dump().

Member Data Documentation

◆ bins

◆ capacity_

unsigned int StatHist::capacity_ = 0
protectedinherited

◆ max_

double StatHist::max_ = 0.0
protectedinherited

Definition at line 108 of file StatHist.h.

Referenced by StatHist::operator+=(), StatHist::operator=(), and operator==().

◆ min_

double StatHist::min_ = 0.0
protectedinherited

◆ scale_

double StatHist::scale_ = 1.0
protectedinherited

Definition at line 111 of file StatHist.h.

Referenced by StatHist::findBin(), StatHist::operator=(), operator==(), and StatHist::val().

◆ val_in

hbase_f* StatHist::val_in = nullptr
protectedinherited

Definition at line 112 of file StatHist.h.

Referenced by StatHist::findBin(), StatHist::operator=(), and operator==().

◆ val_out

hbase_f* StatHist::val_out = nullptr
protectedinherited

Definition at line 113 of file StatHist.h.

Referenced by StatHist::operator=(), operator==(), and StatHist::val().


The documentation for this class was generated from the following file:

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors