From a4691b4a56bfc0d0a95e0636f3f26141aa29a6a6 Mon Sep 17 00:00:00 2001 From: Baber Nawaz Date: Fri, 27 Dec 2024 12:00:54 +0000 Subject: [PATCH] feat: Remove cycles taking zero mics from stats SDB-8410 --- toolbox/io/Runner.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/toolbox/io/Runner.cpp b/toolbox/io/Runner.cpp index 4ef310db..799600e3 100644 --- a/toolbox/io/Runner.cpp +++ b/toolbox/io/Runner.cpp @@ -84,8 +84,10 @@ void run_metrics_reactor(Reactor& r, long busy_cycles, ThreadConfig config, // Don't skew distribution with a lot of zero work. const auto elapsed_us = std::chrono::duration_cast( MonoClock::now() - now.mono_time()); - time_hist->record_value(elapsed_us.count()); - work_hist->record_value(work); + if (elapsed_us.count() != 0) { + time_hist->record_value(elapsed_us.count()); + work_hist->record_value(work); + } loop_cb(now); // Reset counter when work has been done. i = 0;