]> git.ipfire.org Git - thirdparty/squid.git/blame - src/StatCounters.h
SourceFormat Enforcement
[thirdparty/squid.git] / src / StatCounters.h
CommitLineData
e1656dc4 1/*
bde978a6 2 * Copyright (C) 1996-2015 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
e1656dc4
FC
12#include "StatHist.h"
13
14#if USE_CACHE_DIGESTS
e8baef82 15/** statistics for cache digests and other hit "predictors" */
75fbab53
A
16class CacheDigestGuessStats
17{
e1656dc4 18public:
e8baef82
FC
19 int trueHits;
20 int falseHits;
21 int trueMisses;
22 int falseMisses;
23 int closeHits; /// \todo: temporary remove it later
e1656dc4
FC
24};
25#endif
26
e8baef82
FC
27/** General collection of process-wide statistics.
28 *
29 * \note if you add a field to StatCounters,
e1656dc4
FC
30 * you MUST sync statCountersInitSpecial, statCountersClean, and statCountersCopy
31 */
75fbab53
A
32class StatCounters
33{
e1656dc4 34public:
e1656dc4
FC
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;
e8baef82
FC
45 StatHist missSvcTime;
46 StatHist nearMissSvcTime;
47 StatHist nearHitSvcTime;
48 StatHist hitSvcTime;
49 StatHist allSvcTime;
e1656dc4
FC
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;
e8baef82
FC
79 StatHist querySvcTime;
80 StatHist replySvcTime;
e1656dc4
FC
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 {
e8baef82 95 StatHist svcTime;
e1656dc4
FC
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
e8baef82 107 CacheDigestGuessStats guess;
e1656dc4
FC
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;
65d448bc 123 StatHist comm_udp_incoming;
e1656dc4 124 StatHist comm_dns_incoming;
65d448bc 125 StatHist comm_tcp_incoming;
e1656dc4
FC
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;
e4f1fdae
FC
158
159private:
e1656dc4
FC
160};
161
e4f1fdae 162extern StatCounters statCounter;
e1656dc4
FC
163
164#endif /* STATCOUNTERS_H_ */
f53969cc 165