Squid Web Cache
master
Loading...
Searching...
No Matches
Stats.cc
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3
*
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.
7
*/
8
9
#include "
squid.h
"
10
#include "
mem/Allocator.h
"
11
#include "
mem/Pool.h
"
12
#include "
mem/Stats.h
"
13
14
size_t
15
Mem::GlobalStats
(
PoolStats
&stats)
16
{
17
MemPools::GetInstance
().
flushMeters
();
18
19
stats.
meter
= &
TheMeter
;
20
stats.
label
=
"Total"
;
21
stats.
obj_size
= 1;
22
stats.
overhead
+=
sizeof
(
MemPools
);
23
24
/* gather all stats for Totals */
25
size_t
pools_inuse = 0;
26
for
(
const
auto
pool:
MemPools::GetInstance
().
pools
) {
27
if
(pool->getStats(stats) > 0)
28
++pools_inuse;
29
stats.
overhead
+=
sizeof
(
Allocator
*);
30
}
31
32
return
pools_inuse;
33
}
Allocator.h
TheMeter
Mem::PoolMeter TheMeter
memory usage totals as of latest MemPools::flushMeters() event
Definition
Pool.cc:24
Pool.h
MemPools
Definition
Pool.h:61
MemPools::pools
std::list< Mem::Allocator * > pools
Definition
Pool.h:112
MemPools::flushMeters
void flushMeters()
Definition
Pool.cc:72
MemPools::GetInstance
static MemPools & GetInstance()
Definition
Pool.cc:27
Mem::Allocator
Definition
Allocator.h:22
Mem::PoolStats
Definition
Stats.h:18
Mem::PoolStats::label
const char * label
Definition
Stats.h:21
Mem::PoolStats::overhead
int overhead
Definition
Stats.h:36
Mem::PoolStats::obj_size
int obj_size
Definition
Stats.h:23
Mem::PoolStats::meter
PoolMeter * meter
Definition
Stats.h:22
Stats.h
Mem::GlobalStats
size_t GlobalStats(PoolStats &)
Definition
Stats.cc:15
squid.h
squid
src
mem
Stats.cc
Generated by
1.9.8