StoreStats.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2023 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 #ifndef SQUID_SRC_STORESTATS_H
10 #define SQUID_SRC_STORESTATS_H
11 
14 {
15 public:
17  class Part
18  {
19  public:
20  double size = 0.0;
21  double count = 0.0;
22  double capacity = 0.0;
23 
25  double meanObjectSize() const { return count > 0 ? size/count : 0.0; }
26 
28  double available() const { return capacity - size; }
29  };
30 
32  class Swap: public Part
33  {
34  public:
35  double open_disk_fd = 0.0;
36  };
37 
39  class Mem: public Part
40  {
41  public:
42  bool shared = false;
43  };
44 
46 
48  Mem mem;
49 
50  /* stats that could be shared by memory and disk storage */
51  double store_entry_count = 0.0;
52  double mem_object_count = 0.0;
53 };
54 
55 // TODO: this should be adjusted for use in StoreIoActionData, DiskdActionData
58 {
59 public:
60  StoreIoStats();
61 
62  struct {
63  int calls;
66  int success;
67  } create;
68 };
69 
70 #endif /* SQUID_SRC_STORESTATS_H */
71 
double available() const
number of unused bytes
Definition: StoreStats.h:28
double mem_object_count
number of MemObject objects in existence
Definition: StoreStats.h:52
double count
number of cached objects
Definition: StoreStats.h:21
disk cache (all cache_dirs) storage stats
Definition: StoreStats.h:32
double capacity
the size limit
Definition: StoreStats.h:22
double open_disk_fd
number of opened disk files
Definition: StoreStats.h:35
struct StoreIoStats::@133 create
cache_dir selection and disk entry creation stats
double size
bytes currently in use
Definition: StoreStats.h:20
Memory Management.
Definition: Allocator.h:16
StoreInfoStats & operator+=(const StoreInfoStats &stats)
Definition: StoreStats.cc:16
int select_fail
Definition: StoreStats.h:64
Mem mem
all cache_dirs stats
Definition: StoreStats.h:48
Swap swap
cache_mem stats
Definition: StoreStats.h:47
double meanObjectSize() const
mean size of a cached object
Definition: StoreStats.h:25
Info common to memory and disk parts of the storage. Used inside PODs!
Definition: StoreStats.h:17
Store statistics related to low-level I/O.
Definition: StoreStats.h:57
int create_fail
Definition: StoreStats.h:65
bool shared
whether memory cache is shared among workers
Definition: StoreStats.h:42
double store_entry_count
number of StoreEntry objects in existence
Definition: StoreStats.h:51
High-level store statistics used by mgr:info action. Used inside PODs!
Definition: StoreStats.h:13

 

Introduction

Documentation

Support

Miscellaneous