From 4b516f2fe4c1c34e4a1fc60446d98035b39120fd Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Thu, 12 Dec 2024 16:01:56 -0500 Subject: [PATCH] Fix stale ticker values --- src/libraries/JANA/Engine/JExecutionEngine.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libraries/JANA/Engine/JExecutionEngine.cc b/src/libraries/JANA/Engine/JExecutionEngine.cc index f485dc5b0..d4e817dfc 100644 --- a/src/libraries/JANA/Engine/JExecutionEngine.cc +++ b/src/libraries/JANA/Engine/JExecutionEngine.cc @@ -235,14 +235,18 @@ void JExecutionEngine::RunSupervisor() { if (m_interrupt_status == InterruptStatus::InspectRequested) { if (perf.runstatus == RunStatus::Paused) { - PrintFinalReport(); LOG_INFO(GetLogger()) << "Entering inspector" << LOG_END; m_enable_timeout = false; m_interrupt_status = InterruptStatus::InspectInProgress; InspectApplication(GetApplication()); m_interrupt_status = InterruptStatus::NoInterruptsSupervised; + + // Jump back to the top of the loop so that we have fresh event count data + last_measurement_time = clock_t::now(); + last_event_count = 0; + continue; } - else { + else if (perf.runstatus == RunStatus::Running) { PauseTopology(); } } @@ -251,9 +255,10 @@ void JExecutionEngine::RunSupervisor() { } if (m_show_ticker) { - auto last_measurement_duration_ms = std::chrono::duration_cast(clock_t::now() - last_measurement_time).count(); + auto next_measurement_time = clock_t::now(); + auto last_measurement_duration_ms = std::chrono::duration_cast(next_measurement_time - last_measurement_time).count(); float latest_throughput_hz = (last_measurement_duration_ms == 0) ? 0 : (perf.event_count - last_event_count) * 1000.0 / last_measurement_duration_ms; - last_measurement_time = clock_t::now(); + last_measurement_time = next_measurement_time; last_event_count = perf.event_count; // Print rates