]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Refactored statHistIntInit
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 12 Dec 2011 16:46:49 +0000 (17:46 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 12 Dec 2011 16:46:49 +0000 (17:46 +0100)
src/HttpHeader.cc
src/Makefile.am
src/StatHist.cc
src/StatHist.h
src/stat.cc
src/tests/stub_StatHist.cc

index 9d039ba37a9571313ec492246b19bf18b37858b0..5e59aa4ec399a8bc212090bf1f1d14bc377265a9 100644 (file)
@@ -372,10 +372,10 @@ httpHeaderStatInit(HttpHeaderStat * hs, const char *label)
     assert(label);
     memset(hs, 0, sizeof(HttpHeaderStat));
     hs->label = label;
-    statHistEnumInit(&hs->hdrUCountDistr, 32); /* not a real enum */
-    statHistEnumInit(&hs->fieldTypeDistr, HDR_ENUM_END);
-    statHistEnumInit(&hs->ccTypeDistr, CC_ENUM_END);
-    statHistEnumInit(&hs->scTypeDistr, SC_ENUM_END);
+    hs->hdrUCountDistr.enumInit(32);   /* not a real enum */
+    hs->fieldTypeDistr.enumInit(HDR_ENUM_END);
+    hs->ccTypeDistr.enumInit(CC_ENUM_END);
+    hs->scTypeDistr.enumInit(SC_ENUM_END);
 }
 
 /*
index 0671627f970dc9cdbf38c64d6411491137b27b1d..67766eabfe643a735ca7044c044910de39171698 100644 (file)
@@ -1087,6 +1087,7 @@ tests_testHttpReply_SOURCES=\
        StatCounters.h \
        StatCounters.cc \
        StatHist.h \
+       StatHist.cc \
        tests/stub_StatHist.cc \
        tests/stub_store.cc \
        tests/stub_store_stats.cc \
index d1936eaea13383ae225e300dea9ccd8cca2339f9..7dd385e8cba8dca81cd330de080624472c76e8cb 100644 (file)
@@ -274,13 +274,6 @@ 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->enumInit(last_enum);
-}
-
-
 void
 statHistEnumDumper(StoreEntry * sentry, int idx, double val, double size, int count)
 {
@@ -289,12 +282,6 @@ statHistEnumDumper(StoreEntry * sentry, int idx, double val, double size, int co
                           idx, (int) val, count);
 }
 
-void
-statHistIntInit(StatHist * H, int n)
-{
-    H->init(n, Math::Null, Math::Null, (double) 0, (double) n - 1);
-}
-
 void
 statHistIntDumper(StoreEntry * sentry, int idx, double val, double size, int count)
 {
index dde020ab216f818b98646fc396a8d36e04594f44..3ff4bfd92603dcbc7dce6315f89068298d96ed5e 100644 (file)
@@ -31,7 +31,6 @@
 #ifndef STATHIST_H_
 #define STATHIST_H_
 
-#include "config.h"
 #include "typedefs.h"
 
 /*
@@ -68,8 +67,7 @@ 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 statHistEnumInit(StatHist * H, int last_enum);
-void statHistIntInit(StatHist * H, int n);
+//void statHistIntInit(StatHist * H, int n);
 StatHistBinDumper statHistEnumDumper;
 StatHistBinDumper statHistIntDumper;
 
index 22320f829c4df6562d58051cabbec19385155cb0..1291b2074073d4132b7910d029203326c1176ae7 100644 (file)
@@ -1503,11 +1503,11 @@ statCountersInitSpecial(StatCounters * C)
     /*
      * Cache Digest Stuff
      */
-    statHistEnumInit(&C->cd.on_xition_count, CacheDigestHashFuncCount);
-    statHistEnumInit(&C->comm_icp_incoming, INCOMING_ICP_MAX);
-    statHistEnumInit(&C->comm_dns_incoming, INCOMING_DNS_MAX);
-    statHistEnumInit(&C->comm_http_incoming, INCOMING_HTTP_MAX);
-    statHistIntInit(&C->select_fds_hist, 256); /* was SQUID_MAXFD, but it is way too much. It is OK to crop this statistics */
+    C->cd.on_xition_count.enumInit(CacheDigestHashFuncCount);
+    C->comm_icp_incoming.enumInit(INCOMING_ICP_MAX);
+    C->comm_dns_incoming.enumInit(INCOMING_DNS_MAX);
+    C->comm_http_incoming.enumInit(INCOMING_HTTP_MAX);
+    C->select_fds_hist.enumInit(256);  /* was SQUID_MAXFD, but it is way too much. It is OK to crop this statistics */
 }
 
 /* add special cases here as they arrive */
index 2c3caab1460f92294bee4124f03adc0e96abcce8..07f1b4cd3c21cc6173beac25d22a92f0d9c35af7 100644 (file)
@@ -3,20 +3,8 @@
 // for StatHist definitions
 #include "StatHist.h"
 
-void
-StatHist::count(double val)
-{
-    fatal("statHistCount: Not implemented");
-}
-
 void
 statHistEnumInit(StatHist * H, int last_enum)
 {
 //NO-OP    fatal("statHistEnumInit: Not implemented");
 }
-
-void
-StatHist::dump(StoreEntry * sentry, StatHistBinDumper * bd) const
-{
-    // noop
-}