29 assert(val_in_(newMax - newMin) > 0);
41 capacity_(src.capacity_),
48 if (src.
bins!=
nullptr) {
59 const unsigned int bin =
findBin(v);
76 bin =
static_cast <unsigned int>(tmp_bin);
127 h =
int(
s1 * pctile);
133 if (a <= h && h <= b)
155 f = (h - a) / (b - a);
157 K = (
unsigned int) floor(f * (
double) (J - I) + I);
167 idx, val, count, count /
size);
173 double left_border =
min_;
178 for (
unsigned int i = 0; i <
capacity_; ++i) {
179 const double right_border =
val(i + 1);
180 assert(right_border - left_border > 0.0);
181 bd(sentry, i, left_border, right_border - left_border,
bins[i]);
182 left_border = right_border;
193 if (B.
bins ==
nullptr) {
196 if (
bins ==
nullptr) {
200 for (
unsigned int i = 0; i <
capacity_; ++i) {
245 idx, (
int) val, count);
static StatHistBinDumper statHistBinDumper
double statHistDeltaMedian(const StatHist &A, const StatHist &B)
double statHistDeltaPctile(const StatHist &A, const StatHist &B, double pctile)
void StatHistBinDumper(StoreEntry *, int idx, double val, double size, int count)
function signature for StatHist dumping functions
StatHistBinDumper statHistEnumDumper
StatHistBinDumper statHistIntDumper
double hbase_f(double)
function signature for in/out StatHist adaptation
void log(char *format,...)
double deltaPctile(const StatHist &B, double pctile) const
double val(unsigned int bin) const
double max_
value of the maximum counter in the histogram
double scale_
scaling factor when looking for a bin
void logInit(unsigned int capacity, double min, double max)
unsigned int findBin(double v)
bins_type * bins
the histogram counters
void init(unsigned int capacity, hbase_f *val_in, hbase_f *val_out, double min, double max)
void enumInit(unsigned int last_enum)
double min_
minimum value to be stored, corresponding to the first bin
void dump(StoreEntry *sentry, StatHistBinDumper *bd) const
StatHist & operator+=(const StatHist &B)
A const & max(A const &lhs, A const &rhs)
A const & min(A const &lhs, A const &rhs)
void storeAppendPrintf(StoreEntry *e, const char *fmt,...)
void * xcalloc(size_t n, size_t sz)