]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
renamed class iostats to IoStats, moved to own header file.
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 17 Sep 2012 15:12:01 +0000 (17:12 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 17 Sep 2012 15:12:01 +0000 (17:12 +0200)
src/ConfigParser.cc
src/IoStats.h [new file with mode: 0644]
src/Makefile.am
src/globals.h
src/mgr/IoAction.cc
src/mgr/IoAction.h
src/stat.cc
src/structs.h
src/tests/stub_cache_cf.cc
src/wordlist.h

index 848428260bcfb8e807f819bfb0c9a66c2a54a8e8..7c81e44256aebaae26f8a56db1516c232fcb88a2 100644 (file)
@@ -35,6 +35,7 @@
 #include "cache_cf.h"
 #include "ConfigParser.h"
 #include "Debug.h"
+#include "fatal.h"
 #include "globals.h"
 
 void
diff --git a/src/IoStats.h b/src/IoStats.h
new file mode 100644 (file)
index 0000000..2329605
--- /dev/null
@@ -0,0 +1,47 @@
+#ifndef SQUID_IOSTATS_H_
+#define SQUID_IOSTATS_H_
+/*
+ * 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.
+ *
+ */
+
+class IoStats {
+public:
+    static const int histSize=16;
+
+    struct {
+        int reads;
+        int reads_deferred;
+        int read_hist[histSize];
+        int writes;
+        int write_hist[histSize];
+    }
+
+    Http, Ftp, Gopher;
+};
+
+#endif /* SQUID_IOSTATS_H_ */
index 21fe2588b68a36b9b2a881f6754c294c53f1f0d0..21eb44ec0957ef29d847dd3c90e7236640b51cf2 100644 (file)
@@ -468,6 +468,7 @@ squid_SOURCES = \
        SquidMath.h \
        SquidMath.cc \
        SquidNew.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -1501,6 +1502,7 @@ tests_testCacheManager_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -1909,6 +1911,7 @@ tests_testEvent_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.cc \
        SquidMath.h \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -2148,6 +2151,7 @@ tests_testEventLoop_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -2386,6 +2390,7 @@ tests_test_http_range_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -2667,6 +2672,7 @@ tests_testHttpRequest_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
@@ -3747,6 +3753,7 @@ tests_testURL_SOURCES = \
        $(SNMP_SOURCE) \
        SquidMath.h \
        SquidMath.cc \
+       IoStats.h \
        stat.h \
        stat.cc \
        StatCounters.h \
index d6094356cc84e2a522d127bf87d10cd2fddc623e..3980d926d880a0c895b0cc0b725f55d4582f7b54 100644 (file)
 #ifndef SQUID_GLOBALS_H
 #define SQUID_GLOBALS_H
 
+#include "acl/AclDenyInfoList.h"
+#include "CacheDigest.h"
+#include "defines.h"
+#include "hash.h"
+#include "IoStats.h"
+#include "rfc2181.h"
+
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
 
-#include "rfc2181.h"
-
-/* for ERROR_BUF_SZ, BUFSIZ */
-#include "defines.h"
-
-/* for iostats */
-#include "acl/AclDenyInfoList.h"
-#include "CacheDigest.h"
-#include "structs.h"
-
 extern char *ConfigFile;       /* NULL */
 extern char *IcpOpcodeStr[];
 extern char tmp_error_buf[ERROR_BUF_SZ];
@@ -87,7 +84,7 @@ extern int syslog_enable;     /* 0 */
 extern int DnsSocketA;         /* -1 */
 extern int DnsSocketB;         /* -1 */
 extern int n_disk_objects;     /* 0 */
-extern iostats IOStats;
+extern IoStats IOStats;
 
 extern AclDenyInfoList *DenyInfoList;  /* NULL */
 
index 421a903e1fb007da124e1fc7a6c640e6c486f626..06cfbbd2e3e011bc593fcae177193c76d5ef3833 100644 (file)
@@ -5,6 +5,7 @@
 
 #include "squid.h"
 #include "base/TextException.h"
+#include "IoStats.h"
 #include "ipc/Messages.h"
 #include "ipc/TypedMsgHdr.h"
 #include "mgr/IoAction.h"
@@ -24,13 +25,13 @@ Mgr::IoActionData&
 Mgr::IoActionData::operator += (const IoActionData& stats)
 {
     http_reads += stats.http_reads;
-    for (int i = 0; i < iostats::histSize; ++i)
+    for (int i = 0; i < IoStats::histSize; ++i)
         http_read_hist[i] += stats.http_read_hist[i];
     ftp_reads += stats.ftp_reads;
-    for (int i = 0; i < iostats::histSize; ++i)
+    for (int i = 0; i < IoStats::histSize; ++i)
         ftp_read_hist[i] += stats.ftp_read_hist[i];
     gopher_reads += stats.gopher_reads;
-    for (int i = 0; i < iostats::histSize; ++i)
+    for (int i = 0; i < IoStats::histSize; ++i)
         gopher_read_hist[i] += stats.gopher_read_hist[i];
 
     return *this;
index 0925a2c59642cc77dd3737fe33a826f35254c0a5..6487247c1fbc59aa6a785abaea8a9014716c41d4 100644 (file)
@@ -7,7 +7,7 @@
 #define SQUID_MGR_IO_ACTION_H
 
 #include "mgr/Action.h"
-#include "structs.h" /* iostats::histSize */
+#include "IoStats.h"
 
 namespace Mgr
 {
@@ -23,9 +23,9 @@ public:
     double http_reads;
     double ftp_reads;
     double gopher_reads;
-    double http_read_hist[iostats::histSize];
-    double ftp_read_hist[iostats::histSize];
-    double gopher_read_hist[iostats::histSize];
+    double http_read_hist[IoStats::histSize];
+    double ftp_read_hist[IoStats::histSize];
+    double gopher_read_hist[IoStats::histSize];
 };
 
 /// implement aggregated 'io' action
index c78cf1b0038f48e4f99e393c5b630b6072349b03..d65681eeeeaf1d8e4aef97848503dfe71627bf2b 100644 (file)
@@ -42,6 +42,7 @@
 #include "format/Token.h"
 #include "globals.h"
 #include "HttpRequest.h"
+#include "IoStats.h"
 #include "MemObject.h"
 #include "mem_node.h"
 #include "MemBuf.h"
@@ -221,19 +222,19 @@ GetIoStats(Mgr::IoActionData& stats)
 
     stats.http_reads = IOStats.Http.reads;
 
-    for (i = 0; i < iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         stats.http_read_hist[i] = IOStats.Http.read_hist[i];
     }
 
     stats.ftp_reads = IOStats.Ftp.reads;
 
-    for (i = 0; i < iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         stats.ftp_read_hist[i] = IOStats.Ftp.read_hist[i];
     }
 
     stats.gopher_reads = IOStats.Gopher.reads;
 
-    for (i = 0; i < iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         stats.gopher_read_hist[i] = IOStats.Gopher.read_hist[i];
     }
 }
@@ -247,7 +248,7 @@ DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry)
     storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.http_reads);
     storeAppendPrintf(sentry, "Read Histogram:\n");
 
-    for (i = 0; i < iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
                           i ? (1 << (i - 1)) + 1 : 1,
                           1 << i,
@@ -260,7 +261,7 @@ DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry)
     storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.ftp_reads);
     storeAppendPrintf(sentry, "Read Histogram:\n");
 
-    for (i = 0; i < iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
                           i ? (1 << (i - 1)) + 1 : 1,
                           1 << i,
@@ -273,7 +274,7 @@ DumpIoStats(Mgr::IoActionData& stats, StoreEntry* sentry)
     storeAppendPrintf(sentry, "number of reads: %.0f\n", stats.gopher_reads);
     storeAppendPrintf(sentry, "Read Histogram:\n");
 
-    for (i = 0; i < iostats::histSize; ++i) {
+    for (i = 0; i < IoStats::histSize; ++i) {
         storeAppendPrintf(sentry, "%5d-%5d: %9.0f %2.0f%%\n",
                           i ? (1 << (i - 1)) + 1 : 1,
                           1 << i,
index a47763582eac316e7af4010b9f98e36ba23ffa91..63e7c38a401c8d0135d12737615d27b9c704e8cf 100644 (file)
@@ -218,23 +218,6 @@ public:
     int n_peers;
 };
 
-class iostats {
-public:
-    static const int histSize=16;
-
-//    enum { histSize = 16 };
-
-    struct {
-        int reads;
-        int reads_deferred;
-        int read_hist[histSize];
-        int writes;
-        int write_hist[histSize];
-    }
-
-    Http, Ftp, Gopher;
-};
-
 #if USE_SSL
 struct _sslproxy_cert_sign {
     int alg;
index 699ee23e0243f8c5f7ce27025c1f234a0444edd8..f46821d69ed58760cac4d51f99fabca18680f5f7 100644 (file)
@@ -31,6 +31,7 @@
  */
 
 #include "squid.h"
+#include "acl/Acl.h"
 #include "ConfigParser.h"
 #include "wordlist.h"
 #include "YesNoNone.h"
index 31a0536e412001c4274cfd61125ae4a9638a2757..cdbd82a0d1aae2c3dc36b8d85b2aaa96c3467eed 100644 (file)
@@ -45,6 +45,8 @@ public:
 
 MEMPROXY_CLASS_INLINE(wordlist);
 
+class MemBuf;
+
 extern const char *wordlistAdd(wordlist **, const char *);
 extern void wordlistCat(const wordlist *, MemBuf * mb);
 extern void wordlistAddWl(wordlist **, wordlist *);