From b8353aa9eb017f66166da9ee03ad7cd09abda175 Mon Sep 17 00:00:00 2001 From: imarom Date: Thu, 18 Aug 2016 13:49:59 +0300 Subject: CPU util. measurements fix (more accurate and steady) see #trex-246 --- src/utl_cpuu.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/utl_cpuu.cpp') diff --git a/src/utl_cpuu.cpp b/src/utl_cpuu.cpp index 47c78c8e..c01326d6 100755 --- a/src/utl_cpuu.cpp +++ b/src/utl_cpuu.cpp @@ -42,10 +42,11 @@ void CCpuUtlCp::Update(){ if ( m_dpcpu->sample_data() ) { m_work++; } - if (m_ticks==100) { + if (m_ticks==100000) { /* LPF*/ - m_cpu_util_lpf = (m_cpu_util_lpf*0.75)+((double)m_work*0.25); - AppendHistory(m_work); + double work = (m_work / double(m_ticks)) * 100; + m_cpu_util_lpf = (m_cpu_util_lpf*0.75)+(work*0.25); + AppendHistory(work); m_ticks=0; m_work=0; } -- cgit 1.2.3-korg