2 * Copyright (C) 1996-2023 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
25 int closeHits
= 0; // TODO: temporary. remove it later
29 /** General collection of process-wide statistics.
31 * \note if you add a field to StatCounters which requires any non-trivial
32 * initialization or copy you MUST sync statCountersInitSpecial()
37 StatCounters() : timestamp(current_time
) {}
46 ByteCounter kbytes_in
;
47 ByteCounter kbytes_out
;
48 ByteCounter hit_kbytes_out
;
50 StatHist nearMissSvcTime
;
51 StatHist nearHitSvcTime
;
61 ByteCounter kbytes_in
;
62 ByteCounter kbytes_out
;
63 } all
, http
, ftp
, other
;
75 int replies_queued
= 0;
76 int replies_dropped
= 0;
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
;
83 StatHist querySvcTime
;
84 StatHist replySvcTime
;
85 int query_timeouts
= 0;
104 ByteCounter kbytes_sent
;
105 ByteCounter kbytes_recv
;
109 #if USE_CACHE_DIGESTS
110 CacheDigestGuessStats guess
;
112 StatHist on_xition_count
;
119 unsigned long int select_loops
= 0;
121 double select_time
= 0.0;
122 double cputime
= 0.0;
124 struct timeval timestamp
;
125 #if USE_POLL || USE_SELECT
126 Comm::Incoming comm_dns
;
127 Comm::Incoming comm_tcp
;
128 Comm::Incoming comm_udp
;
130 StatHist select_fds_hist
;
155 int aborted_requests
= 0;
158 int files_cleaned
= 0;
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;
173 extern StatCounters statCounter
;
175 #endif /* SQUID_SRC_STATCOUNTERS_H */