/* * Copyright (C) 1996-2024 The Squid Software Foundation and contributors * * Squid software is distributed under GPLv2+ license and includes * contributions from numerous individuals and organizations. * Please see the COPYING and CONTRIBUTORS files for details. */ #ifndef SQUID_SRC_SBUF_STATS_H #define SQUID_SRC_SBUF_STATS_H #include /** * Container for various SBuf class-wide statistics. * * The stats are not completely accurate; they're mostly meant to * understand whether Squid is leaking resources * and whether SBuf is paying off the expected gains. */ class SBufStats { public: ///Dump statistics to an ostream. std::ostream& dump(std::ostream &os) const; SBufStats& operator +=(const SBufStats&); /// Record the size a SBuf had when it was destructed static void RecordSBufSizeAtDestruct(size_t); /// Record the size a MemBlob had when it was destructed static void RecordMemBlobSizeAtDestruct(size_t); public: uint64_t alloc = 0; ///