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