]>
Commit | Line | Data |
---|---|---|
e1656dc4 | 1 | /* |
ef57eb7b | 2 | * Copyright (C) 1996-2016 The Squid Software Foundation and contributors |
e1656dc4 | 3 | * |
bbc27441 AJ |
4 | * Squid software is distributed under GPLv2+ license and includes |
5 | * contributions from numerous individuals and organizations. | |
6 | * Please see the COPYING and CONTRIBUTORS files for details. | |
e1656dc4 | 7 | */ |
bbc27441 | 8 | |
e1656dc4 FC |
9 | #ifndef STATCOUNTERS_H_ |
10 | #define STATCOUNTERS_H_ | |
11 | ||
a0864754 | 12 | #include "base/ByteCounter.h" |
e1656dc4 FC |
13 | #include "StatHist.h" |
14 | ||
15 | #if USE_CACHE_DIGESTS | |
e8baef82 | 16 | /** statistics for cache digests and other hit "predictors" */ |
75fbab53 A |
17 | class CacheDigestGuessStats |
18 | { | |
e1656dc4 | 19 | public: |
e8baef82 FC |
20 | int trueHits; |
21 | int falseHits; | |
22 | int trueMisses; | |
23 | int falseMisses; | |
24 | int closeHits; /// \todo: temporary remove it later | |
e1656dc4 FC |
25 | }; |
26 | #endif | |
27 | ||
e8baef82 FC |
28 | /** General collection of process-wide statistics. |
29 | * | |
30 | * \note if you add a field to StatCounters, | |
e1656dc4 FC |
31 | * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy |
32 | */ | |
75fbab53 A |
33 | class StatCounters |
34 | { | |
e1656dc4 | 35 | public: |
e1656dc4 FC |
36 | struct { |
37 | int clients; | |
38 | int requests; | |
39 | int hits; | |
40 | int mem_hits; | |
41 | int disk_hits; | |
42 | int errors; | |
a0864754 AJ |
43 | ByteCounter kbytes_in; |
44 | ByteCounter kbytes_out; | |
45 | ByteCounter hit_kbytes_out; | |
e8baef82 FC |
46 | StatHist missSvcTime; |
47 | StatHist nearMissSvcTime; | |
48 | StatHist nearHitSvcTime; | |
49 | StatHist hitSvcTime; | |
50 | StatHist allSvcTime; | |
e1656dc4 FC |
51 | } client_http; |
52 | ||
53 | struct { | |
54 | ||
55 | struct { | |
56 | int requests; | |
57 | int errors; | |
a0864754 AJ |
58 | ByteCounter kbytes_in; |
59 | ByteCounter kbytes_out; | |
e1656dc4 FC |
60 | } all , http, ftp, other; |
61 | } server; | |
62 | ||
63 | struct { | |
64 | int pkts_sent; | |
65 | int queries_sent; | |
66 | int replies_sent; | |
67 | int pkts_recv; | |
68 | int queries_recv; | |
69 | int replies_recv; | |
70 | int hits_sent; | |
71 | int hits_recv; | |
72 | int replies_queued; | |
73 | int replies_dropped; | |
a0864754 AJ |
74 | ByteCounter kbytes_sent; |
75 | ByteCounter q_kbytes_sent; | |
76 | ByteCounter r_kbytes_sent; | |
77 | ByteCounter kbytes_recv; | |
78 | ByteCounter q_kbytes_recv; | |
79 | ByteCounter r_kbytes_recv; | |
e8baef82 FC |
80 | StatHist querySvcTime; |
81 | StatHist replySvcTime; | |
e1656dc4 FC |
82 | int query_timeouts; |
83 | int times_used; | |
84 | } icp; | |
85 | ||
86 | struct { | |
87 | int pkts_sent; | |
88 | int pkts_recv; | |
89 | } htcp; | |
90 | ||
91 | struct { | |
92 | int requests; | |
93 | } unlink; | |
94 | ||
95 | struct { | |
e8baef82 | 96 | StatHist svcTime; |
e1656dc4 FC |
97 | } dns; |
98 | ||
99 | struct { | |
100 | int times_used; | |
a0864754 AJ |
101 | ByteCounter kbytes_sent; |
102 | ByteCounter kbytes_recv; | |
103 | ByteCounter memory; | |
e1656dc4 FC |
104 | int msgs_sent; |
105 | int msgs_recv; | |
106 | #if USE_CACHE_DIGESTS | |
107 | ||
e8baef82 | 108 | CacheDigestGuessStats guess; |
e1656dc4 FC |
109 | #endif |
110 | ||
111 | StatHist on_xition_count; | |
112 | } cd; | |
113 | ||
114 | struct { | |
115 | int times_used; | |
116 | } netdb; | |
117 | int page_faults; | |
118 | unsigned long int select_loops; | |
119 | int select_fds; | |
120 | double select_time; | |
121 | double cputime; | |
122 | ||
123 | struct timeval timestamp; | |
65d448bc | 124 | StatHist comm_udp_incoming; |
e1656dc4 | 125 | StatHist comm_dns_incoming; |
65d448bc | 126 | StatHist comm_tcp_incoming; |
e1656dc4 FC |
127 | StatHist select_fds_hist; |
128 | ||
129 | struct { | |
130 | struct { | |
131 | int opens; | |
132 | int closes; | |
133 | int reads; | |
134 | int writes; | |
135 | int seeks; | |
136 | int unlinks; | |
137 | } disk; | |
138 | ||
139 | struct { | |
140 | int accepts; | |
141 | int sockets; | |
142 | int connects; | |
143 | int binds; | |
144 | int closes; | |
145 | int reads; | |
146 | int writes; | |
147 | int recvfroms; | |
148 | int sendtos; | |
149 | } sock; | |
150 | int selects; | |
151 | } syscalls; | |
152 | int aborted_requests; | |
153 | ||
154 | struct { | |
155 | int files_cleaned; | |
156 | int outs; | |
157 | int ins; | |
158 | } swap; | |
e4f1fdae FC |
159 | |
160 | private: | |
e1656dc4 FC |
161 | }; |
162 | ||
e4f1fdae | 163 | extern StatCounters statCounter; |
e1656dc4 FC |
164 | |
165 | #endif /* STATCOUNTERS_H_ */ | |
f53969cc | 166 |