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