69 "SBuf stats:\nnumber of allocations: " <<
alloc <<
72 "\nlive references: " <<
live <<
74 "\nclearing operations: " <<
clear <<
75 "\nappend operations: " <<
append <<
76 "\nmove operations: " <<
moves <<
81 "\ncomparisons not requiring data-scan: " <<
compareFast <<
82 "\ncopy-out ops: " <<
copyOut <<
83 "\nraw access to memory: " <<
rawAccess <<
85 "\nchop operations: " <<
chop <<
86 "\ntrim operations: " <<
trim <<
90 "\nCOW replaced with memmove(3): " <<
cowShift <<
91 "\nCOW requiring an empty buffer allocation: " <<
cowJustAlloc <<
92 "\nCOW requiring allocation and copying: " <<
cowAllocCopy <<
93 "\naverage store share factor: " <<
94 (ststats.
live != 0 ?
static_cast<float>(
live)/ststats.
live : 0) <<
Various MemBlob class-wide statistics.
uint64_t live
number of MemBlob instances currently alive
static const MemBlobStats & GetStats()
obtain a const view of class-wide statistics
uint64_t trim
number of trim operations
uint64_t append
number of append operations
std::ostream & dump(std::ostream &os) const
Dump statistics to an ostream.
uint64_t cowShift
number of cow() calls requiring just a memmove(3) inside an old buffer
uint64_t nulTerminate
number of c_str() terminations
SBufStats & operator+=(const SBufStats &)
uint64_t moves
number of move constructions/assignments
uint64_t cowJustAlloc
number of cow() calls requiring just a new empty buffer
uint64_t rawAccess
number of accesses to raw contents
uint64_t assignFast
number of no-copy assignment operations
static void RecordMemBlobSizeAtDestruct(size_t)
Record the size a MemBlob had when it was destructed.
uint64_t cowAllocCopy
number of cow() calls requiring copying into a new buffer
uint64_t getChar
number of calls to at() and operator[]
uint64_t setChar
number of calls to setAt
uint64_t caseChange
number of toUpper and toLower operations
uint64_t cowAvoided
number of cow() calls requiring no expensive operations
static SizeRecorder SBufSizeAtDestructRecorder
collects statistics about SBuf sizes at SBuf destruction time
uint64_t compareFast
number of comparison operations not requiring data scan
uint64_t chop
number of chop operations
uint64_t clear
number of clear operations
static void RecordSBufSizeAtDestruct(size_t)
Record the size a SBuf had when it was destructed.
static SizeRecorder MemBlobSizeAtDestructRecorder
collects statistics about MemBlob capacity at MemBlob destruction time
uint64_t toStream
number of write operations to ostreams
uint64_t compareSlow
number of comparison operations requiring data scan
uint64_t allocCopy
number of calls to SBuf copy-constructor
uint64_t alloc
number of calls to SBuf constructors
uint64_t find
number of find operations
uint64_t live
number of currently-allocated SBuf
uint64_t copyOut
number of data-copies to other forms of buffers
uint64_t allocFromCString
number of copy-allocations from c-strings
void(*)(size_t) SizeRecorder
function for collecting detailed size-related statistics