]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Moved StatHist class to its own header-file, included the header from all relevant...
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 5 Dec 2011 16:52:47 +0000 (17:52 +0100)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 5 Dec 2011 16:52:47 +0000 (17:52 +0100)
22 files changed:
src/CacheDigest.cc
src/HttpHdrCc.cc
src/HttpHdrScTarget.cc
src/HttpHeader.cc
src/Makefile.am
src/StatHist.cc
src/StatHist.h [new file with mode: 0644]
src/client_side.cc
src/comm/ModDevPoll.cc
src/comm/ModEpoll.cc
src/comm/ModPoll.cc
src/comm/ModSelect.cc
src/comm/ModSelectWin32.cc
src/fqdncache.cc
src/icp_v2.cc
src/ipcache.cc
src/protos.h
src/snmp_agent.cc
src/stat.cc
src/structs.h
src/tests/stub_StatHist.cc
src/typedefs.h

index 0830c480f68f5beebae52a620333dbef84c4ecdd..9f649cd5f2b2fd19253bfbacb03952abb7a82471 100644 (file)
@@ -34,6 +34,7 @@
  */
 
 #include "squid.h"
+#include "StatHist.h"
 #include "Store.h"
 
 #if USE_CACHE_DIGESTS
index 43dc2510ceeb50775e3a7a4f0f57c556f7889e05..a913c9dc5100a154a4f21ebae103d02512df2777 100644 (file)
 
 #include "squid.h"
 #include "base/StringArea.h"
-#include "Store.h"
 #include "HttpHeader.h"
 #include "HttpHdrCc.h"
+#include "StatHist.h"
+#include "Store.h"
 
 #if HAVE_MAP
 #include <map>
index 8b2f12a0c7ef61e7977c3e4120ce74b59ac0c28f..1639ccb76ee38fa75aa5e457da70d4f74be4ebb3 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "squid.h"
 #include "HttpHdrSc.h"
+#include "StatHist.h"
 
 extern http_hdr_sc_type &operator++ (http_hdr_sc_type &aHeader);
 /* copies non-extant fields from new_sc to this sc */
index 68a844ec98fe5051778d5c3531a8c86eb7c616ca..ab9cdc44f1fb184547ea7ef8074dca57fcc5cc41 100644 (file)
@@ -42,6 +42,7 @@
 #include "MemBuf.h"
 #include "mgr/Registration.h"
 #include "rfc1123.h"
+#include "StatHist.h"
 #include "Store.h"
 #include "TimeOrTag.h"
 
index a981692874d4de0486805c2e64c24a2717f33d67..4eaea62a398ebf9ef3e28466e4c60ddd1ad6082e 100644 (file)
@@ -424,6 +424,7 @@ squid_SOURCES = \
        SquidMath.cc \
        SquidNew.cc \
        stat.cc \
+       StatHist.h \
        StatHist.cc \
        String.cc \
        stmem.cc \
@@ -1080,6 +1081,7 @@ tests_testHttpReply_SOURCES=\
        tests/stub_cache_manager.cc \
        tests/stub_debug.cc \
        tests/stub_HelperChildConfig.cc \
+       StatHist.h \
        tests/stub_StatHist.cc \
        tests/stub_store.cc \
        tests/stub_store_stats.cc \
@@ -1156,6 +1158,7 @@ tests_testACLMaxUserIP_SOURCES= \
        Packer.cc \
        Parsing.cc \
        SquidMath.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        String.cc \
@@ -1353,6 +1356,7 @@ tests_testCacheManager_SOURCES = \
        SquidMath.h \
        SquidMath.cc \
        stat.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
@@ -1475,6 +1479,7 @@ tests_testDiskIO_SOURCES = \
        Parsing.cc \
        refresh.cc \
        RemovalPolicy.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        StoreFileSystem.cc \
@@ -1678,6 +1683,7 @@ tests_testEvent_SOURCES = \
        SquidMath.cc \
        SquidMath.h \
        stat.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
@@ -1867,6 +1873,7 @@ tests_testEventLoop_SOURCES = \
        SquidMath.h \
        SquidMath.cc \
        stat.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
@@ -2052,6 +2059,7 @@ tests_test_http_range_SOURCES = \
        SquidMath.h \
        SquidMath.cc \
        stat.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
@@ -2276,6 +2284,7 @@ tests_testHttpRequest_SOURCES = \
        SquidMath.h \
        SquidMath.cc \
        stat.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
@@ -2390,6 +2399,7 @@ tests_testStore_SOURCES= \
        Parsing.cc \
        RemovalPolicy.cc \
        refresh.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
@@ -2621,6 +2631,7 @@ tests_testUfs_SOURCES = \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
        url.cc \
+       StatHist.h \
        StatHist.cc \
        HttpHdrRange.cc \
        ETag.cc \
@@ -2713,6 +2724,7 @@ tests_testRock_SOURCES = \
        Packer.cc \
        Parsing.cc \
        RemovalPolicy.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
@@ -2880,6 +2892,7 @@ tests_testCoss_SOURCES = \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
        url.cc \
+       StatHist.h \
        StatHist.cc \
        HttpHdrRange.cc \
        ETag.cc \
@@ -3014,6 +3027,7 @@ tests_testNull_SOURCES = \
        HttpHdrSc.cc \
        HttpHdrScTarget.cc \
        url.cc \
+       StatHist.h \
        StatHist.cc \
        HttpHdrRange.cc \
        ETag.cc \
@@ -3163,6 +3177,7 @@ tests_testURL_SOURCES = \
        SquidMath.h \
        SquidMath.cc \
        stat.cc \
+       StatHist.h \
        StatHist.cc \
        stmem.cc \
        store.cc \
index 6b82e9bfd5e229d2514738f5caec3b83085bd028..4d60b4e7f8196cfbc878138e143ba5ade8a03404 100644 (file)
@@ -46,6 +46,7 @@
  */
 
 #include "squid.h"
+#include "StatHist.h"
 #include "Store.h"
 
 /* Local functions */
diff --git a/src/StatHist.h b/src/StatHist.h
new file mode 100644 (file)
index 0000000..13ea6e7
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * SQUID Web Proxy Cache          http://www.squid-cache.org/
+ * ----------------------------------------------------------
+ *
+ *  Squid is the result of efforts by numerous individuals from
+ *  the Internet community; see the CONTRIBUTORS file for full
+ *  details.   Many organizations have provided support for Squid's
+ *  development; see the SPONSORS file for full details.  Squid is
+ *  Copyrighted (C) 2001 by the Regents of the University of
+ *  California; see the COPYRIGHT file for full details.  Squid
+ *  incorporates software developed and/or copyrighted by other
+ *  sources; see the CREDITS file for full details.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
+ *
+ *  AUTHOR: Francesco Chemolli
+ */
+
+#ifndef STATHIST_H_
+#define STATHIST_H_
+
+/*
+ * "very generic" histogram;
+ * see important comments on hbase_f restrictions in StatHist.c
+ */
+
+class StatHist {
+public:
+    int *bins;
+    int capacity;
+    double min;
+    double max;
+    double scale;
+    hbase_f *val_in;        /* e.g., log() for log-based histogram */
+    hbase_f *val_out;       /* e.g., exp() for log based histogram */
+};
+
+/* StatHist */
+SQUIDCEXTERN void statHistClean(StatHist * H);
+SQUIDCEXTERN void statHistCount(StatHist * H, double val);
+SQUIDCEXTERN void statHistCopy(StatHist * Dest, const StatHist * Orig);
+SQUIDCEXTERN void statHistSafeCopy(StatHist * Dest, const StatHist * Orig);
+SQUIDCEXTERN double statHistDeltaMedian(const StatHist * A, const StatHist * B);
+SQUIDCEXTERN double statHistDeltaPctile(const StatHist * A, const StatHist * B, double pctile);
+SQUIDCEXTERN void statHistDump(const StatHist * H, StoreEntry * sentry, StatHistBinDumper * bd);
+SQUIDCEXTERN void statHistLogInit(StatHist * H, int capacity, double min, double max);
+SQUIDCEXTERN void statHistEnumInit(StatHist * H, int last_enum);
+SQUIDCEXTERN void statHistIntInit(StatHist * H, int n);
+SQUIDCEXTERN StatHistBinDumper statHistEnumDumper;
+SQUIDCEXTERN StatHistBinDumper statHistIntDumper;
+
+
+
+
+#endif /* STATHIST_H_ */
index 2504571bf4310cec8b3676bdd2c7fd2968af0e55..e4fe53206197fe277f9466d8cbe059a0501d03e6 100644 (file)
 #include "MemObject.h"
 #include "ProtoPort.h"
 #include "rfc1738.h"
+#include "StatHist.h"
 #include "SquidTime.h"
 #if USE_SSL
 #include "ssl/context_storage.h"
index 8db2585e74d40c90411cecac4509d2038e695f42..5c790ec2066efe7a3d31327e7a927708ef651ab7 100644 (file)
@@ -59,6 +59,7 @@
 #include "fde.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
+#include "StatHist.h"
 #include "Store.h"
 
 #if HAVE_SYS_DEVPOLL_H
index f19df2f2c7dfa9d20bb6e0f16db27348b4dc8d9e..51e6a86e806e7b43ffeb467cf29d7579b3407e19 100644 (file)
@@ -60,6 +60,7 @@
 #include "fde.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
+#include "StatHist.h"
 #include "Store.h"
 
 #define DEBUG_EPOLL 0
index cbb00bc971a9f25b7aaae83b74bff944c0783f1a..ecc950ea8460e8ee9a9dbdc607c884ab6b10d261 100644 (file)
@@ -41,6 +41,7 @@
 #include "ICP.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
+#include "StatHist.h"
 #include "Store.h"
 
 #if HAVE_POLL_H
index d18feef2a765d036cf2cb6dc43eaaa6fe4307d72..a3a16ff97e17af1bb9034d0f6d79cdd3088235db 100644 (file)
@@ -41,6 +41,7 @@
 #include "mgr/Registration.h"
 #include "SquidTime.h"
 #include "Store.h"
+#include "StatHist.h"
 #include "fde.h"
 
 static int MAX_POLL_TIME = 1000;       /* see also Comm::QuickPollRequired() */
index 4763437949691d921f49a3389e699d21d33012c7..dd8a8aeb1dbb492f303af055ebf9937592847093 100644 (file)
@@ -40,6 +40,7 @@
 #include "fde.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
+#include "StatHist.h"
 #include "Store.h"
 
 static int MAX_POLL_TIME = 1000;       /* see also Comm::QuickPollRequired() */
index 39ee90b3fdfa1f5b7cde85c372d30a5bc68a18f7..375b7e4ee3f09c86e1c73813be5652f43043c7a2 100644 (file)
@@ -38,6 +38,7 @@
 #include "event.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
+#include "StatHist.h"
 #include "Store.h"
 #include "wordlist.h"
 
index e6437ee831ab4113d868c481b8074027ac2abceb..e3992f199a55e382f37b797bddd676f9faac065e 100644 (file)
@@ -46,6 +46,7 @@
 #include "acl/Acl.h"
 #include "AccessLogEntry.h"
 #include "wordlist.h"
+#include "StatHist.h"
 #include "SquidTime.h"
 #include "SwapDir.h"
 #include "icmp/net_db.h"
index ce69f12572916029d318bda0b03384fb11d154ea..97993d0b524b309dfbdb21f767dd8e642bdcf893 100644 (file)
@@ -40,6 +40,7 @@
 #include "ipcache.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
+#include "StatHist.h"
 #include "Store.h"
 #include "wordlist.h"
 
index dd38345cbd7df872dcdecfec1f53bc818f11c498..1df24fa0336a8f2ae8be7ccb5293fb2cf0b452b7 100644 (file)
@@ -222,6 +222,8 @@ SQUIDCEXTERN const char *httpMakeVaryMark(HttpRequest * request, HttpReply const
 #include "HttpStatusCode.h"
 SQUIDCEXTERN const char *httpStatusString(http_status status);
 
+class StatHist;
+
 /* Http Cache Control Header Field */
 SQUIDCEXTERN void httpHdrCcInitModule(void);
 SQUIDCEXTERN void httpHdrCcCleanModule(void);
@@ -400,21 +402,6 @@ SQUIDCEXTERN double statRequestHitMemoryRatio(int minutes);
 SQUIDCEXTERN double statRequestHitDiskRatio(int minutes);
 SQUIDCEXTERN double statByteHitRatio(int minutes);
 
-/* StatHist */
-SQUIDCEXTERN void statHistClean(StatHist * H);
-SQUIDCEXTERN void statHistCount(StatHist * H, double val);
-SQUIDCEXTERN void statHistCopy(StatHist * Dest, const StatHist * Orig);
-SQUIDCEXTERN void statHistSafeCopy(StatHist * Dest, const StatHist * Orig);
-SQUIDCEXTERN double statHistDeltaMedian(const StatHist * A, const StatHist * B);
-SQUIDCEXTERN double statHistDeltaPctile(const StatHist * A, const StatHist * B, double pctile);
-SQUIDCEXTERN void statHistDump(const StatHist * H, StoreEntry * sentry, StatHistBinDumper * bd);
-SQUIDCEXTERN void statHistLogInit(StatHist * H, int capacity, double min, double max);
-SQUIDCEXTERN void statHistEnumInit(StatHist * H, int last_enum);
-SQUIDCEXTERN void statHistIntInit(StatHist * H, int n);
-SQUIDCEXTERN StatHistBinDumper statHistEnumDumper;
-SQUIDCEXTERN StatHistBinDumper statHistIntDumper;
-
-
 /* mem */
 SQUIDCEXTERN void memClean(void);
 SQUIDCEXTERN void memInitModule(void);
index 4dd122e29f843148919e529282e4670c37594780..db88c5976c3e4ed557563c212def0d2efb49bd5d 100644 (file)
@@ -36,6 +36,7 @@
 #include "cache_snmp.h"
 #include "Store.h"
 #include "mem_node.h"
+#include "StatHist.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
 
index be507e01b10249cd9ca2de6dd895085a5eed2825..b7d617103a325e0b4f12dbc95653085758cb9eec 100644 (file)
@@ -54,6 +54,7 @@
 #include "MemBuf.h"
 #include "SquidMath.h"
 #include "SquidTime.h"
+#include "StatHist.h"
 #include "mgr/CountersAction.h"
 #include "mgr/FunAction.h"
 #include "mgr/InfoAction.h"
index 49e16e9ae1c9a489112202d20a7cb9c188b93cc5..d398e95485c4722e3ad0222e2f03b8235f9492db 100644 (file)
@@ -1099,26 +1099,13 @@ struct _refresh_t {
     int max_stale;
 };
 
-/*
- * "very generic" histogram;
- * see important comments on hbase_f restrictions in StatHist.c
- */
-
-struct _StatHist {
-    int *bins;
-    int capacity;
-    double min;
-    double max;
-    double scale;
-    hbase_f *val_in;           /* e.g., log() for log-based histogram */
-    hbase_f *val_out;          /* e.g., exp() for log based histogram */
-};
-
 /*
  * if you add a field to StatCounters,
  * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy
  */
 
+#include "StatHist.h"
+
 struct _StatCounters {
 
     struct {
index 9bcc5857f16d01638f43649d8fd5e5496f78a457..330bba5f20c3b45031264a46d5b09bba53fc6ac9 100644 (file)
@@ -1,7 +1,7 @@
 #include "squid.h"
 
 // for StatHist definitions
-#include "protos.h"
+#include "StatHist.h"
 
 void
 statHistDump(const StatHist * H, StoreEntry * sentry, StatHistBinDumper * bd)
index 6b3f2164b727aa0e06bdbca4f6a4c8cbd927a2a5..dca39340a960ef1b37b5365d2d523d9e4cd001f4 100644 (file)
@@ -92,8 +92,6 @@ typedef struct _StatCounters StatCounters;
 
 typedef struct _storeSwapLogData storeSwapLogData;
 
-typedef struct _StatHist StatHist;
-
 typedef struct _cd_guess_stats cd_guess_stats;
 
 typedef struct _CacheDigest CacheDigest;