From 20aee4199c21526b259088c5dadd4ce4899b736d Mon Sep 17 00:00:00 2001 From: Rob Blafford Date: Mon, 21 Aug 2023 15:54:42 -0400 Subject: [PATCH 1/2] kafka/s: Fix incorrectly formatted log in usage --- src/v/kafka/server/usage_aggregator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v/kafka/server/usage_aggregator.h b/src/v/kafka/server/usage_aggregator.h index fec90a0e33c8..e0d8d08cb203 100644 --- a/src/v/kafka/server/usage_aggregator.h +++ b/src/v/kafka/server/usage_aggregator.h @@ -45,8 +45,8 @@ std::chrono::time_point round_to_interval( "usage has detected a timestamp '{}' that exceeds the preconfigured " "threshold of {}s meaning a clock has fired later or earlier then " "expected, this is unexpected behavior and should be investigated.", - std::chrono::duration_cast(interval), - t.time_since_epoch().count()); + t.time_since_epoch().count(), + std::chrono::duration_cast(err_threshold)); return t; } From 19bf8803b171272cb7a5769481c8ed83ce8f0e77 Mon Sep 17 00:00:00 2001 From: Rob Blafford Date: Mon, 21 Aug 2023 15:55:04 -0400 Subject: [PATCH 2/2] kafka/s: Raise error threshold for tests in usage - Fixes: #12678 --- src/v/kafka/server/usage_aggregator.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v/kafka/server/usage_aggregator.h b/src/v/kafka/server/usage_aggregator.h index e0d8d08cb203..8f71405614ca 100644 --- a/src/v/kafka/server/usage_aggregator.h +++ b/src/v/kafka/server/usage_aggregator.h @@ -32,7 +32,7 @@ std::chrono::time_point round_to_interval( /// error if this cannot be done within some threshold. using namespace std::chrono_literals; const auto interval = usage_window_width_interval; - const auto err_threshold = interval < 2min ? 1s : 2min; + const auto err_threshold = interval < 2min ? 2s : 2min; const auto cur_interval_start = t - (t.time_since_epoch() % interval); const auto next_interval_start = cur_interval_start + interval; if (t - cur_interval_start <= err_threshold) {