From 4016b888fb8daeb4b57b526be72aecf08d8163a3 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Fri, 13 Sep 2024 09:26:34 +0200 Subject: [PATCH] Introduce a "too large" counter for the framestream remote logger --- pdns/fstrm_logger.cc | 2 +- pdns/fstrm_logger.hh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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(); -- 2.47.2