]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
StatHist data members are now protected, not private.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 10 Dec 2011 22:02:17 +0000 (23:02 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Sat, 10 Dec 2011 22:02:17 +0000 (23:02 +0100)
ported some clients from statHistLogInit to StatHist::logInit

src/StatHist.cc
src/StatHist.h
src/stat.cc

index 2ec43bcf547c6b253fc5b4b9cae6856ee50b0648..23b0846ebc2edadb47f63b83c7677f35e10bd57a 100644 (file)
@@ -254,10 +254,16 @@ Math::Exp(double x)
     return exp(x) - 1.0;
 }
 
+void
+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->init(capacity, Math::Log, Math::Exp, min, max);
+    H->logInit(capacity, min, max);
 }
 
 /* linear histogram for enums */
index 77c573807662ada9fe26a68ddc7a7d4208fdd42c..7438030b2cb45661a54709fe5d12518ff3f6b51d 100644 (file)
@@ -54,7 +54,7 @@ public:
     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);
-private:
+protected:
     int findBin(double v);
     int *bins;
     int capacity;
@@ -75,7 +75,4 @@ void statHistIntInit(StatHist * H, int n);
 StatHistBinDumper statHistEnumDumper;
 StatHistBinDumper statHistIntDumper;
 
-
-
-
 #endif /* STATHIST_H_ */
index 0f0b4d74634da42d0d4eb6409b46a39d48830702..22320f829c4df6562d58051cabbec19385155cb0 100644 (file)
@@ -1486,20 +1486,20 @@ statCountersInitSpecial(StatCounters * C)
     /*
      * HTTP svc_time hist is kept in milli-seconds; max of 3 hours.
      */
-    statHistLogInit(&C->client_http.all_svc_time, 300, 0.0, 3600000.0 * 3.0);
-    statHistLogInit(&C->client_http.miss_svc_time, 300, 0.0, 3600000.0 * 3.0);
-    statHistLogInit(&C->client_http.nm_svc_time, 300, 0.0, 3600000.0 * 3.0);
-    statHistLogInit(&C->client_http.nh_svc_time, 300, 0.0, 3600000.0 * 3.0);
-    statHistLogInit(&C->client_http.hit_svc_time, 300, 0.0, 3600000.0 * 3.0);
+    C->client_http.all_svc_time.logInit(300, 0.0, 3600000.0 * 3.0);
+    C->client_http.miss_svc_time.logInit(300, 0.0, 3600000.0 * 3.0);
+    C->client_http.nm_svc_time.logInit(300, 0.0, 3600000.0 * 3.0);
+    C->client_http.nh_svc_time.logInit(300, 0.0, 3600000.0 * 3.0);
+    C->client_http.hit_svc_time.logInit(300, 0.0, 3600000.0 * 3.0);
     /*
      * ICP svc_time hist is kept in micro-seconds; max of 1 minute.
      */
-    statHistLogInit(&C->icp.query_svc_time, 300, 0.0, 1000000.0 * 60.0);
-    statHistLogInit(&C->icp.reply_svc_time, 300, 0.0, 1000000.0 * 60.0);
+    C->icp.query_svc_time.logInit(300, 0.0, 1000000.0 * 60.0);
+    C->icp.reply_svc_time.logInit(300, 0.0, 1000000.0 * 60.0);
     /*
      * DNS svc_time hist is kept in milli-seconds; max of 10 minutes.
      */
-    statHistLogInit(&C->dns.svc_time, 300, 0.0, 60000.0 * 10.0);
+    C->dns.svc_time.logInit(300, 0.0, 60000.0 * 10.0);
     /*
      * Cache Digest Stuff
      */