]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Introduce a "too large" counter for the framestream remote logger 14666/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 13 Sep 2024 07:26:34 +0000 (09:26 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 13 Sep 2024 07:26:34 +0000 (09:26 +0200)
pdns/fstrm_logger.cc
pdns/fstrm_logger.hh

index 7c839e7b19d61e71e24298d89d79555e7b566940..9e224790fd67cd38dca09766e84e115c2ebcd51e 100644 (file)
@@ -170,7 +170,7 @@ RemoteLoggerInterface::Result FrameStreamLogger::queueData(const std::string& da
   }
   uint8_t* frame = (uint8_t*)malloc(data.length()); // NOLINT: it's the API
   if (frame == nullptr) {
-    ++d_queueFullDrops; // XXX separate count?
+    ++d_tooLargeCount;
     return Result::TooLarge;
   }
   memcpy(frame, data.c_str(), data.length());
index 711c65a17189388daa39006b9b1f55a946840c42..44657247d86aafc16e362b100c709e08c611f932 100644 (file)
@@ -63,7 +63,7 @@ public:
   {
     return Stats{.d_queued = d_framesSent,
                  .d_pipeFull = d_queueFullDrops,
-                 .d_tooLarge = 0,
+                 .d_tooLarge = d_tooLargeCount,
                  .d_otherError = d_permanentFailures};
   }
 
@@ -81,6 +81,7 @@ private:
   struct fstrm_iothr* d_iothr{nullptr};
   std::atomic<uint64_t> d_framesSent{0};
   std::atomic<uint64_t> d_queueFullDrops{0};
+  std::atomic<uint64_t> d_tooLargeCount{0};
   std::atomic<uint64_t> d_permanentFailures{0};
 
   void cleanup();