2 * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
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.
9 #ifndef SQUID_SRC_STATCOUNTERS_H
10 #define SQUID_SRC_STATCOUNTERS_H
12 #include "base/ByteCounter.h"
13 #include "comm/Incoming.h"
17 /** statistics for cache digests and other hit "predictors" */
18 class CacheDigestGuessStats
28 /** General collection of process-wide statistics.
30 * \note if you add a field to StatCounters which requires any non-trivial
31 * initialization or copy you MUST sync statCountersInitSpecial()
36 StatCounters() : timestamp(current_time
) {}
45 ByteCounter kbytes_in
;
46 ByteCounter kbytes_out
;
47 ByteCounter hit_kbytes_out
;
49 StatHist nearMissSvcTime
;
50 StatHist nearHitSvcTime
;
60 ByteCounter kbytes_in
;
61 ByteCounter kbytes_out
;
62 } all
, http
, ftp
, other
;
74 int replies_queued
= 0;
75 int replies_dropped
= 0;
76 ByteCounter kbytes_sent
;
77 ByteCounter q_kbytes_sent
;
78 ByteCounter r_kbytes_sent
;
79 ByteCounter kbytes_recv
;
80 ByteCounter q_kbytes_recv
;
81 ByteCounter r_kbytes_recv
;
82 StatHist querySvcTime
;
83 StatHist replySvcTime
;
84 int query_timeouts
= 0;
103 ByteCounter kbytes_sent
;
104 ByteCounter kbytes_recv
;
108 #if USE_CACHE_DIGESTS
109 CacheDigestGuessStats guess
;
111 StatHist on_xition_count
;
118 unsigned long int select_loops
= 0;
120 double select_time
= 0.0;
121 double cputime
= 0.0;
123 struct timeval timestamp
;
124 #if USE_POLL || USE_SELECT
125 Comm::Incoming comm_dns
;
126 Comm::Incoming comm_tcp
;
127 Comm::Incoming comm_udp
;
129 StatHist select_fds_hist
;
154 int aborted_requests
= 0;
157 int files_cleaned
= 0;
163 uint64_t attempts
= 0;
164 uint64_t refusalsDueToLocking
= 0;
165 uint64_t refusalsDueToZeroSize
= 0;
166 uint64_t refusalsDueToTimeLimit
= 0;
167 uint64_t failures
= 0;
172 extern StatCounters statCounter
;
174 #endif /* SQUID_SRC_STATCOUNTERS_H */