]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
NONWORKING: try subclassing instead of C-style pseudoconstructors.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 7 Dec 2011 12:27:14 +0000 (13:27 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Wed, 7 Dec 2011 12:27:14 +0000 (13:27 +0100)
src/StatHist.cc
src/StatHist.h
src/stat.cc
src/structs.h

index 85f28bd3dc3dee134b4109e1cba3cc1e185818c6..072f4db26a1e7ad2c211509bb31f78efab25382c 100644 (file)
@@ -288,3 +288,8 @@ statHistIntDumper(StoreEntry * sentry, int idx, double val, double size, int cou
     if (count)
         storeAppendPrintf(sentry, "%9d\t%9d\n", (int) val, count);
 }
+
+StatHistLog::StatHistLog(int capacity_, double min_, double max_)
+{
+    init(capacity_, Math::Log, Math::Exp, min_, max_);
+}
index e128b4a48e8309790e6ad3cd93b490439523217f..ee3258116aa4adac3b27a5847a8a237072d1a4dd 100644 (file)
@@ -56,7 +56,6 @@ public:
             val_in(NULL), val_out(NULL) {};
     StatHist(const StatHist&);
     void dump(StoreEntry *sentry, StatHistBinDumper * bd) const;
-    void logInit(int capacity, double min, double max);
     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);
@@ -64,6 +63,14 @@ private:
     int findBin(double v);
 };
 
+class StatHistLog: public StatHist
+{
+    public:
+    StatHistLog(int capacity_, double min_, double max_);
+};
+
+
+
 /* StatHist */
 void statHistCount(StatHist * H, double val);
 double statHistDeltaMedian(const StatHist & A, const StatHist & B);
index 033782e0172d72d4c06828e6899702593977d029..60dd5a1578d53014b0fdc7a1085d0f01cce83a83 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);
+    //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);
     /*
      * 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);
+//    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);
     /*
      * 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);
+//    statHistLogInit(&C->dns.svc_time, 300, 0.0, 60000.0 * 10.0);
     /*
      * Cache Digest Stuff
      */
index d398e95485c4722e3ad0222e2f03b8235f9492db..5dd8ae17499aae0a8e2d3e956697eeea1cf2aae4 100644 (file)
@@ -1118,11 +1118,11 @@ struct _StatCounters {
         kb_t kbytes_in;
         kb_t kbytes_out;
         kb_t hit_kbytes_out;
-        StatHist miss_svc_time;
-        StatHist nm_svc_time;
-        StatHist nh_svc_time;
-        StatHist hit_svc_time;
-        StatHist all_svc_time;
+        StatHistLog miss_svc_time(300, 0.0, 3600000.0 * 3.0);
+        StatHistLog nm_svc_time(300, 0.0, 3600000.0 * 3.0);
+        StatHistLog nh_svc_time(300, 0.0, 3600000.0 * 3.0);
+        StatHistLog hit_svc_time(300, 0.0, 3600000.0 * 3.0);
+        StatHistLog all_svc_time(300, 0.0, 3600000.0 * 3.0);
     } client_http;
 
     struct {
@@ -1152,8 +1152,8 @@ struct _StatCounters {
         kb_t kbytes_recv;
         kb_t q_kbytes_recv;
         kb_t r_kbytes_recv;
-        StatHist query_svc_time;
-        StatHist reply_svc_time;
+        StatHistLog query_svc_time(300, 0.0, 1000000.0 * 60.0);
+        StatHistLog reply_svc_time(300, 0.0, 1000000.0 * 60.0);
         int query_timeouts;
         int times_used;
     } icp;
@@ -1168,7 +1168,7 @@ struct _StatCounters {
     } unlink;
 
     struct {
-        StatHist svc_time;
+        StatHistLog svc_time(300, 0.0, 60000.0 * 10.0);
     } dns;
 
     struct {