]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Refactored void statHistLogInit
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 11 Dec 2011 12:10:22 +0000 (13:10 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sun, 11 Dec 2011 12:10:22 +0000 (13:10 +0100)
Started refactoring statHistEnumInit

src/StatHist.cc
src/StatHist.h

index 23b0846ebc2edadb47f63b83c7677f35e10bd57a..d1936eaea13383ae225e300dea9ccd8cca2339f9 100644 (file)
@@ -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)
 {
index 7438030b2cb45661a54709fe5d12518ff3f6b51d..dde020ab216f818b98646fc396a8d36e04594f44 100644 (file)
@@ -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;