]> git.ipfire.org Git - thirdparty/squid.git/blob - src/StatCounters.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / StatCounters.h
1 /*
2 * Copyright (C) 1996-2017 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 "base/ByteCounter.h"
13 #include "StatHist.h"
14
15 #if USE_CACHE_DIGESTS
16 /** statistics for cache digests and other hit "predictors" */
17 class CacheDigestGuessStats
18 {
19 public:
20 int trueHits;
21 int falseHits;
22 int trueMisses;
23 int falseMisses;
24 int closeHits; /// \todo: temporary remove it later
25 };
26 #endif
27
28 /** General collection of process-wide statistics.
29 *
30 * \note if you add a field to StatCounters,
31 * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy
32 */
33 class StatCounters
34 {
35 public:
36 struct {
37 int clients;
38 int requests;
39 int hits;
40 int mem_hits;
41 int disk_hits;
42 int errors;
43 ByteCounter kbytes_in;
44 ByteCounter kbytes_out;
45 ByteCounter hit_kbytes_out;
46 StatHist missSvcTime;
47 StatHist nearMissSvcTime;
48 StatHist nearHitSvcTime;
49 StatHist hitSvcTime;
50 StatHist allSvcTime;
51 } client_http;
52
53 struct {
54
55 struct {
56 int requests;
57 int errors;
58 ByteCounter kbytes_in;
59 ByteCounter kbytes_out;
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;
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;
80 StatHist querySvcTime;
81 StatHist replySvcTime;
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 {
96 StatHist svcTime;
97 } dns;
98
99 struct {
100 int times_used;
101 ByteCounter kbytes_sent;
102 ByteCounter kbytes_recv;
103 ByteCounter memory;
104 int msgs_sent;
105 int msgs_recv;
106 #if USE_CACHE_DIGESTS
107
108 CacheDigestGuessStats guess;
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;
124 StatHist comm_udp_incoming;
125 StatHist comm_dns_incoming;
126 StatHist comm_tcp_incoming;
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;
159
160 private:
161 };
162
163 extern StatCounters statCounter;
164
165 #endif /* STATCOUNTERS_H_ */
166