]>
git.ipfire.org Git - thirdparty/squid.git/blob - src/StoreStats.h
2 * Copyright (C) 1996-2014 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_STORE_STATS_H
10 #define SQUID_STORE_STATS_H
12 /// High-level store statistics used by mgr:info action. Used inside PODs!
16 /// Info common to memory and disk parts of the storage. Used inside PODs!
20 double size
; ///< bytes currently in use
21 double count
; ///< number of cached objects
22 double capacity
; ///< the size limit
24 /// mean size of a cached object
25 double meanObjectSize() const { return count
> 0 ? size
/count
: 0.0; }
27 /// number of unused bytes
28 double available() const { return capacity
- size
; }
31 /// disk cache (all cache_dirs) storage stats
32 class Swap
: public Part
35 double open_disk_fd
; ///< number of opened disk files
38 /// memory cache (cache_mem) storage stats
39 class Mem
: public Part
42 bool shared
; ///< whether memory cache is shared among workers
46 StoreInfoStats
&operator +=(const StoreInfoStats
&stats
);
48 Swap swap
; ///< cache_mem stats
49 Mem mem
; ///< all cache_dirs stats
51 /* stats that could be shared by memory and disk storage */
52 double store_entry_count
; ///< number of StoreEntry objects in existence
53 double mem_object_count
; ///< number of MemObject objects in existence
56 // TODO: this should be adjusted for use in StoreIoActionData, DiskdActionData
57 /// Store statistics related to low-level I/O.
68 } create
; ///< cache_dir selection and disk entry creation stats
71 #endif /* SQUID_STORE_STATS_H */