diff options
author | imarom <imarom@cisco.com> | 2016-08-18 13:49:59 +0300 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-08-18 13:52:49 +0300 |
commit | b8353aa9eb017f66166da9ee03ad7cd09abda175 (patch) | |
tree | 416cd03e701fdb2209034d04ea37bdc8a21bf3f4 /src/utl_cpuu.cpp | |
parent | 5f530a21aa669b4ddc0f8d0329794d0c439f6879 (diff) |
CPU util. measurements fix (more accurate and steady)
see #trex-246
Diffstat (limited to 'src/utl_cpuu.cpp')
-rwxr-xr-x | src/utl_cpuu.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
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; } |