From 4c1722feacff84528ae042c401adf2793e954533 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Thu, 6 Aug 2026 11:37:12 +1000 Subject: [PATCH] [idd] scheduler: report actual acquired frame rate Derive the source rate from unique frames observed over the actual log interval. The old EWMA discarded intervals below 2 ms, capping the reported rate at 500 Hz and understating high-rate sources. --- idd/LGIdd/CFrameScheduler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/idd/LGIdd/CFrameScheduler.cpp b/idd/LGIdd/CFrameScheduler.cpp index 100e826b..45a2126e 100644 --- a/idd/LGIdd/CFrameScheduler.cpp +++ b/idd/LGIdd/CFrameScheduler.cpp @@ -709,15 +709,18 @@ void CFrameScheduler::LogStatistics(uint64_t now) return; } + const uint64_t elapsed = now - m_lastLog; const uint64_t acquired = m_acquiredFrames - m_lastLogAcquired; const uint64_t skipped = m_skippedFrames - m_lastLogSkipped; const uint64_t published = m_publishedFrames - m_lastLogPublished; - DEBUG_TRACE("Frame schedule owner %u: %.3f Hz client, %.3f Hz guest, " + const double acquiredRate = + static_cast(acquired) * 1000000000.0 / elapsed; + DEBUG_TRACE("Frame schedule owner %u: %.3f Hz client, %.3f Hz acquired, " "%.3f ms work, %.3f ms phase; %llu acquired, %llu skipped, " "%llu published", m_schedule.clientID, 1000000000.0 / m_schedule.period, - m_guestPeriod ? 1000000000.0 / m_guestPeriod : 0.0, + acquiredRate, m_workEstimate / 1000000.0, m_lastPhaseError / 1000000.0, static_cast(acquired),