]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/StoreStats.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / StoreStats.h
index 9be6f67a202c6ed44ccd0a2a17a9a04d49c751f0..ab746fdd0bdede3646e0b55f59f7464541dcf456 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (C) 1996-2023 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_STORE_STATS_H
 #define SQUID_STORE_STATS_H
 
@@ -9,9 +17,9 @@ public:
     class Part
     {
     public:
-        double size; ///< bytes currently in use
-        double count; ///< number of cached objects
-        double capacity; ///< the size limit
+        double size = 0.0; ///< bytes currently in use
+        double count = 0.0; ///< number of cached objects
+        double capacity = 0.0; ///< the size limit
 
         /// mean size of a cached object
         double meanObjectSize() const { return count > 0 ? size/count : 0.0; }
@@ -24,27 +32,24 @@ public:
     class Swap: public Part
     {
     public:
-        double open_disk_fd; ///< number of opened disk files
+        double open_disk_fd = 0.0; ///< number of opened disk files
     };
 
     /// memory cache (cache_mem) storage stats
     class Mem: public Part
     {
     public:
-        bool shared; ///< whether memory cache is shared among workers
+        bool shared = false; ///< whether memory cache is shared among workers
     };
 
-
-    StoreInfoStats();
     StoreInfoStats &operator +=(const StoreInfoStats &stats);
 
-
     Swap swap; ///< cache_mem stats
     Mem mem; ///< all cache_dirs stats
 
     /* stats that could be shared by memory and disk storage */
-    double store_entry_count; ///< number of StoreEntry objects in existence
-    double mem_object_count; ///< number of MemObject objects in existence
+    double store_entry_count = 0.0; ///< number of StoreEntry objects in existence
+    double mem_object_count = 0.0; ///< number of MemObject objects in existence
 };
 
 // TODO: this should be adjusted for use in StoreIoActionData, DiskdActionData
@@ -63,3 +68,4 @@ public:
 };
 
 #endif /* SQUID_STORE_STATS_H */
+