]> git.ipfire.org Git - thirdparty/squid.git/blame - src/StatCounters.h
Bug 5428: Warn if pkg-config is not found (#1902)
[thirdparty/squid.git] / src / StatCounters.h
CommitLineData
e1656dc4 1/*
b8ae064d 2 * Copyright (C) 1996-2023 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
ff9d9458
FC
9#ifndef SQUID_SRC_STATCOUNTERS_H
10#define SQUID_SRC_STATCOUNTERS_H
e1656dc4 11
a0864754 12#include "base/ByteCounter.h"
17c0af35 13#include "comm/Incoming.h"
e1656dc4
FC
14#include "StatHist.h"
15
16#if USE_CACHE_DIGESTS
e8baef82 17/** statistics for cache digests and other hit "predictors" */
75fbab53
A
18class CacheDigestGuessStats
19{
e1656dc4 20public:
b56b37cf
AJ
21 int trueHits = 0;
22 int falseHits = 0;
23 int trueMisses = 0;
24 int falseMisses = 0;
9837567d 25 int closeHits = 0; // TODO: temporary. remove it later
e1656dc4
FC
26};
27#endif
28
e8baef82
FC
29/** General collection of process-wide statistics.
30 *
b56b37cf
AJ
31 * \note if you add a field to StatCounters which requires any non-trivial
32 * initialization or copy you MUST sync statCountersInitSpecial()
e1656dc4 33 */
75fbab53
A
34class StatCounters
35{
e1656dc4 36public:
b56b37cf
AJ
37 StatCounters() : timestamp(current_time) {}
38
e1656dc4 39 struct {
b56b37cf
AJ
40 int clients = 0;
41 int requests = 0;
42 int hits = 0;
43 int mem_hits = 0;
44 int disk_hits = 0;
45 int errors = 0;
a0864754
AJ
46 ByteCounter kbytes_in;
47 ByteCounter kbytes_out;
48 ByteCounter hit_kbytes_out;
e8baef82
FC
49 StatHist missSvcTime;
50 StatHist nearMissSvcTime;
51 StatHist nearHitSvcTime;
52 StatHist hitSvcTime;
53 StatHist allSvcTime;
e1656dc4
FC
54 } client_http;
55
56 struct {
57
58 struct {
b56b37cf
AJ
59 int requests = 0;
60 int errors = 0;
a0864754
AJ
61 ByteCounter kbytes_in;
62 ByteCounter kbytes_out;
9e167fa2 63 } all, http, ftp, other;
e1656dc4
FC
64 } server;
65
66 struct {
b56b37cf
AJ
67 int pkts_sent = 0;
68 int queries_sent = 0;
69 int replies_sent = 0;
70 int pkts_recv = 0;
71 int queries_recv = 0;
72 int replies_recv = 0;
73 int hits_sent = 0;
74 int hits_recv = 0;
75 int replies_queued = 0;
76 int replies_dropped = 0;
a0864754
AJ
77 ByteCounter kbytes_sent;
78 ByteCounter q_kbytes_sent;
79 ByteCounter r_kbytes_sent;
80 ByteCounter kbytes_recv;
81 ByteCounter q_kbytes_recv;
82 ByteCounter r_kbytes_recv;
e8baef82
FC
83 StatHist querySvcTime;
84 StatHist replySvcTime;
b56b37cf
AJ
85 int query_timeouts = 0;
86 int times_used = 0;
e1656dc4
FC
87 } icp;
88
89 struct {
b56b37cf
AJ
90 int pkts_sent = 0;
91 int pkts_recv = 0;
e1656dc4
FC
92 } htcp;
93
94 struct {
b56b37cf 95 int requests = 0;
e1656dc4
FC
96 } unlink;
97
98 struct {
e8baef82 99 StatHist svcTime;
e1656dc4
FC
100 } dns;
101
102 struct {
b56b37cf 103 int times_used = 0;
a0864754
AJ
104 ByteCounter kbytes_sent;
105 ByteCounter kbytes_recv;
106 ByteCounter memory;
b56b37cf
AJ
107 int msgs_sent = 0;
108 int msgs_recv = 0;
e1656dc4 109#if USE_CACHE_DIGESTS
e8baef82 110 CacheDigestGuessStats guess;
e1656dc4 111#endif
e1656dc4
FC
112 StatHist on_xition_count;
113 } cd;
114
115 struct {
b56b37cf 116 int times_used = 0;
e1656dc4 117 } netdb;
b56b37cf
AJ
118 int page_faults = 0;
119 unsigned long int select_loops = 0;
120 int select_fds = 0;
121 double select_time = 0.0;
122 double cputime = 0.0;
e1656dc4
FC
123
124 struct timeval timestamp;
17c0af35
AJ
125#if USE_POLL || USE_SELECT
126 Comm::Incoming comm_dns;
127 Comm::Incoming comm_tcp;
128 Comm::Incoming comm_udp;
129#endif
e1656dc4
FC
130 StatHist select_fds_hist;
131
132 struct {
133 struct {
b56b37cf
AJ
134 int opens = 0;
135 int closes = 0;
136 int reads = 0;
137 int writes = 0;
138 int seeks = 0;
139 int unlinks = 0;
e1656dc4
FC
140 } disk;
141
142 struct {
b56b37cf
AJ
143 int accepts = 0;
144 int sockets = 0;
145 int connects = 0;
146 int binds = 0;
147 int closes = 0;
148 int reads = 0;
149 int writes = 0;
150 int recvfroms = 0;
151 int sendtos = 0;
e1656dc4 152 } sock;
b56b37cf 153 int selects = 0;
e1656dc4 154 } syscalls;
b56b37cf 155 int aborted_requests = 0;
e1656dc4
FC
156
157 struct {
b56b37cf
AJ
158 int files_cleaned = 0;
159 int outs = 0;
160 int ins = 0;
e1656dc4 161 } swap;
b2aca62a
EB
162
163 struct {
164 uint64_t attempts = 0;
165 uint64_t refusalsDueToLocking = 0;
166 uint64_t refusalsDueToZeroSize = 0;
167 uint64_t refusalsDueToTimeLimit = 0;
168 uint64_t failures = 0;
169 } hitValidation;
170
e1656dc4
FC
171};
172
e4f1fdae 173extern StatCounters statCounter;
e1656dc4 174
ff9d9458 175#endif /* SQUID_SRC_STATCOUNTERS_H */
f53969cc 176