From: Otto Moerbeek Date: Fri, 13 Sep 2024 07:26:34 +0000 (+0200) Subject: Introduce a "too large" counter for the framestream remote logger X-Git-Tag: rec-5.2.0-alpha1~84^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F14666%2Fhead;p=thirdparty%2Fpdns.git Introduce a "too large" counter for the framestream remote logger --- diff --git a/pdns/fstrm_logger.cc b/pdns/fstrm_logger.cc index 7c839e7b19..9e224790fd 100644 --- a/pdns/fstrm_logger.cc +++ b/pdns/fstrm_logger.cc @@ -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()); diff --git a/pdns/fstrm_logger.hh b/pdns/fstrm_logger.hh index 711c65a171..44657247d8 100644 --- a/pdns/fstrm_logger.hh +++ b/pdns/fstrm_logger.hh @@ -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 d_framesSent{0}; std::atomic d_queueFullDrops{0}; + std::atomic d_tooLargeCount{0}; std::atomic d_permanentFailures{0}; void cleanup();