]> git.ipfire.org Git - thirdparty/squid.git/blob - src/StatCounters.h
Implemented proper distructor for StatHist
[thirdparty/squid.git] / src / StatCounters.h
1 /*
2 * SQUID Web Proxy Cache http://www.squid-cache.org/
3 * ----------------------------------------------------------
4 *
5 * Squid is the result of efforts by numerous individuals from
6 * the Internet community; see the CONTRIBUTORS file for full
7 * details. Many organizations have provided support for Squid's
8 * development; see the SPONSORS file for full details. Squid is
9 * Copyrighted (C) 2001 by the Regents of the University of
10 * California; see the COPYRIGHT file for full details. Squid
11 * incorporates software developed and/or copyrighted by other
12 * sources; see the CREDITS file for full details.
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
27 *
28 * AUTHOR: Francesco Chemolli (Harvest-derived)
29 *
30 */
31 #ifndef STATCOUNTERS_H_
32 #define STATCOUNTERS_H_
33
34 #include "StatHist.h"
35
36 #if USE_CACHE_DIGESTS
37 /* statistics for cache digests and other hit "predictors" */
38 class cd_guess_stats {
39 public:
40 /* public, read-only */
41 int true_hits;
42 int false_hits;
43 int true_misses;
44 int false_misses;
45 int close_hits; /* tmp, remove it later */
46 };
47 #endif
48
49
50 /*
51 * if you add a field to StatCounters,
52 * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy
53 */
54 class StatCounters {
55 public:
56 struct {
57 int clients;
58 int requests;
59 int hits;
60 int mem_hits;
61 int disk_hits;
62 int errors;
63 kb_t kbytes_in;
64 kb_t kbytes_out;
65 kb_t hit_kbytes_out;
66 StatHist miss_svc_time;
67 StatHist nm_svc_time;
68 StatHist nh_svc_time;
69 StatHist hit_svc_time;
70 StatHist all_svc_time;
71 } client_http;
72
73 struct {
74
75 struct {
76 int requests;
77 int errors;
78 kb_t kbytes_in;
79 kb_t kbytes_out;
80 } all , http, ftp, other;
81 } server;
82
83 struct {
84 int pkts_sent;
85 int queries_sent;
86 int replies_sent;
87 int pkts_recv;
88 int queries_recv;
89 int replies_recv;
90 int hits_sent;
91 int hits_recv;
92 int replies_queued;
93 int replies_dropped;
94 kb_t kbytes_sent;
95 kb_t q_kbytes_sent;
96 kb_t r_kbytes_sent;
97 kb_t kbytes_recv;
98 kb_t q_kbytes_recv;
99 kb_t r_kbytes_recv;
100 StatHist query_svc_time;
101 StatHist reply_svc_time;
102 int query_timeouts;
103 int times_used;
104 } icp;
105
106 struct {
107 int pkts_sent;
108 int pkts_recv;
109 } htcp;
110
111 struct {
112 int requests;
113 } unlink;
114
115 struct {
116 StatHist svc_time;
117 } dns;
118
119 struct {
120 int times_used;
121 kb_t kbytes_sent;
122 kb_t kbytes_recv;
123 kb_t memory;
124 int msgs_sent;
125 int msgs_recv;
126 #if USE_CACHE_DIGESTS
127
128 cd_guess_stats guess;
129 #endif
130
131 StatHist on_xition_count;
132 } cd;
133
134 struct {
135 int times_used;
136 } netdb;
137 int page_faults;
138 unsigned long int select_loops;
139 int select_fds;
140 double select_time;
141 double cputime;
142
143 struct timeval timestamp;
144 StatHist comm_icp_incoming;
145 StatHist comm_dns_incoming;
146 StatHist comm_http_incoming;
147 StatHist select_fds_hist;
148
149 struct {
150 struct {
151 int opens;
152 int closes;
153 int reads;
154 int writes;
155 int seeks;
156 int unlinks;
157 } disk;
158
159 struct {
160 int accepts;
161 int sockets;
162 int connects;
163 int binds;
164 int closes;
165 int reads;
166 int writes;
167 int recvfroms;
168 int sendtos;
169 } sock;
170 int selects;
171 } syscalls;
172 int aborted_requests;
173
174 struct {
175 int files_cleaned;
176 int outs;
177 int ins;
178 } swap;
179
180 private:
181 };
182
183 extern StatCounters statCounter;
184
185 #endif /* STATCOUNTERS_H_ */