]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/sbuf/Stats.h
d70ff83dc9ee210288e6079f23e2a135002aeeef
2 * Copyright (C) 1996-2016 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_SBUF_STATS_H
10 #define SQUID_SBUF_STATS_H
15 * Container for various SBuf class-wide statistics.
17 * The stats are not completely accurate; they're mostly meant to
18 * understand whether Squid is leaking resources
19 * and whether SBuf is paying off the expected gains.
24 uint64_t alloc
; ///<number of calls to SBuf constructors
25 uint64_t allocCopy
; ///<number of calls to SBuf copy-constructor
26 uint64_t allocFromCString
; ///<number of copy-allocations from c-strings
27 uint64_t assignFast
; ///<number of no-copy assignment operations
28 uint64_t clear
; ///<number of clear operations
29 uint64_t append
; ///<number of append operations
30 uint64_t moves
; ///<number of move constructions/assignments
31 uint64_t toStream
; ///<number of write operations to ostreams
32 uint64_t setChar
; ///<number of calls to setAt
33 uint64_t getChar
; ///<number of calls to at() and operator[]
34 uint64_t compareSlow
; ///<number of comparison operations requiring data scan
35 uint64_t compareFast
; ///<number of comparison operations not requiring data scan
36 uint64_t copyOut
; ///<number of data-copies to other forms of buffers
37 uint64_t rawAccess
; ///<number of accesses to raw contents
38 uint64_t nulTerminate
; ///<number of c_str() terminations
39 uint64_t chop
; ///<number of chop operations
40 uint64_t trim
; ///<number of trim operations
41 uint64_t find
; ///<number of find operations
42 uint64_t scanf
; ///<number of scanf operations
43 uint64_t caseChange
; ///<number of toUpper and toLower operations
44 uint64_t cowFast
; ///<number of cow operations not actually requiring a copy
45 uint64_t cowSlow
; ///<number of cow operations requiring a copy
46 uint64_t live
; ///<number of currently-allocated SBuf
48 ///Dump statistics to an ostream.
49 std::ostream
& dump(std::ostream
&os
) const;
52 SBufStats
& operator +=(const SBufStats
&);
55 #endif /* SQUID_SBUF_STATS_H */