]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/mgr/CountersAction.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / mgr / CountersAction.cc
index f9fa61e0ba0d7b16c49070bc309c978ee0d7d01e..b5ffed3c5351ccdfc51262d306fef62cc971b8c8 100644 (file)
@@ -1,10 +1,13 @@
 /*
- * $Id$
- *
- * DEBUG: section 16    Cache Manager API
+ * Copyright (C) 1996-2021 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.
  */
 
+/* DEBUG: section 16    Cache Manager API */
+
 #include "squid.h"
 #include "base/TextException.h"
 #include "ipc/Messages.h"
 #include "mgr/CountersAction.h"
 #include "SquidTime.h"
 #include "Store.h"
+#include "tools.h"
 
-
-extern void GetCountersStats(Mgr::CountersActionData& stats);
-extern void DumpCountersStats(Mgr::CountersActionData& stats, StoreEntry* sentry);
+void GetCountersStats(Mgr::CountersActionData& stats);
+void DumpCountersStats(Mgr::CountersActionData& stats, StoreEntry* sentry);
 
 Mgr::CountersActionData::CountersActionData()
 {
-    xmemset(this, 0, sizeof(*this));
+    memset(this, 0, sizeof(*this));
 }
 
 Mgr::CountersActionData&
@@ -82,6 +85,11 @@ Mgr::CountersActionData::operator += (const CountersActionData& stats)
     swap_ins += stats.swap_ins;
     swap_files_cleaned += stats.swap_files_cleaned;
     aborted_requests += stats.aborted_requests;
+    hitValidationAttempts += stats.hitValidationAttempts;
+    hitValidationRefusalsDueToLocking += stats.hitValidationRefusalsDueToLocking;
+    hitValidationRefusalsDueToZeroSize += stats.hitValidationRefusalsDueToZeroSize;
+    hitValidationRefusalsDueToTimeLimit += stats.hitValidationRefusalsDueToTimeLimit;
+    hitValidationFailures += stats.hitValidationFailures;
 
     return *this;
 }
@@ -92,8 +100,8 @@ Mgr::CountersAction::Create(const CommandPointer &cmd)
     return new CountersAction(cmd);
 }
 
-Mgr::CountersAction::CountersAction(const CommandPointer &cmd):
-        Action(cmd), data()
+Mgr::CountersAction::CountersAction(const CommandPointer &aCmd):
+    Action(aCmd), data()
 {
     debugs(16, 5, HERE);
 }
@@ -133,3 +141,4 @@ Mgr::CountersAction::unpack(const Ipc::TypedMsgHdr& msg)
     msg.checkType(Ipc::mtCacheMgrResponse);
     msg.getPod(data);
 }
+