From: Francesco Chemolli Date: Sun, 11 Dec 2011 12:10:22 +0000 (+0100) Subject: Refactored void statHistLogInit X-Git-Tag: BumpSslServerFirst.take05~12^2~120^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d982012ae902e07e6a3e0cab45bf88f38d5bf3d9;p=thirdparty%2Fsquid.git Refactored void statHistLogInit Started refactoring statHistEnumInit --- diff --git a/src/StatHist.cc b/src/StatHist.cc index 23b0846ebc..d1936eaea1 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -260,12 +260,6 @@ StatHist::logInit(int capacity, double min, double max) init(capacity, Math::Log, Math::Exp, min, max); } -void -statHistLogInit(StatHist * H, int capacity, double min, double max) -{ - H->logInit(capacity, min, max); -} - /* linear histogram for enums */ /* we want to be have [-1,last_enum+1] range to track out of range enums */ double @@ -274,12 +268,19 @@ Math::Null(double x) return x; } +void +StatHist::enumInit(int last_enum) +{ + init(last_enum + 3, Math::Null, Math::Null, (double) -1, (double) (last_enum + 1 + 1)); +} + void statHistEnumInit(StatHist * H, int last_enum) { - H->init(last_enum + 3, Math::Null, Math::Null, (double) -1, (double) (last_enum + 1 + 1)); + H->enumInit(last_enum); } + void statHistEnumDumper(StoreEntry * sentry, int idx, double val, double size, int count) { diff --git a/src/StatHist.h b/src/StatHist.h index 7438030b2c..dde020ab21 100644 --- a/src/StatHist.h +++ b/src/StatHist.h @@ -53,7 +53,6 @@ public: void enumInit(int last_enum); void intInit(int n); void init(int capacity, hbase_f * val_in, hbase_f * val_out, double min, double max); - double deltaPctile(const StatHist & B, double pctile); protected: int findBin(double v); int *bins; @@ -69,7 +68,6 @@ protected: void statHistCount(StatHist * H, double val); double statHistDeltaMedian(const StatHist & A, const StatHist & B); double statHistDeltaPctile(const StatHist & A, const StatHist & B, double pctile); -void statHistLogInit(StatHist * H, int capacity, double min, double max); void statHistEnumInit(StatHist * H, int last_enum); void statHistIntInit(StatHist * H, int n); StatHistBinDumper statHistEnumDumper;