Skip to content

Commit

Permalink
Merge pull request #12916 from graphcareful/usage-threshold
Browse files Browse the repository at this point in the history
tests: Raise the rounding timestamp error threshold for testing
  • Loading branch information
Rob Blafford authored Aug 23, 2023
2 parents dbbc633 + 19bf880 commit 3e31dad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/v/kafka/server/usage_aggregator.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ std::chrono::time_point<clock_type, duration> 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) {
Expand All @@ -45,8 +45,8 @@ std::chrono::time_point<clock_type, duration> 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<std::chrono::seconds>(interval),
t.time_since_epoch().count());
t.time_since_epoch().count(),
std::chrono::duration_cast<std::chrono::seconds>(err_threshold));
return t;
}

Expand Down

0 comments on commit 3e31dad

Please sign in to comment.