Bug 444127

Summary: System monitor shows negative read speeds
Product: [Plasma] plasma-systemmonitor Reporter: David <david.cortes.rivera>
Component: generalAssignee: KSysGuard Developers <ksysguard-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ahiemstra, bugseforuns, nate, plasma-bugs
Priority: NOR    
Version: 5.23.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.24

Description David 2021-10-20 16:17:40 UTC
SUMMARY
When I go to the "Applications" page of the system monitor app, at the beginning it will show negative reading speeds for apps, which disappear after 1 second or so.

STEPS TO REPRODUCE
1. Launch system monitor.
2. Go to the "Applications" page.
3. Watch the column "Read".

OBSERVED RESULT
Shows negative speeds.

EXPECTED RESULT
Should not show anything for applications that are not doing IO, and should not in any case display negative numbers.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux
KDE Plasma Version: 5.23.0
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2
Kernel Version: 5.14.0-3-amd64 (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 2700 Eight-Core Processor
Memory: 15.5 GiB of RAM
Graphics Processor: AMD VEGA10

ADDITIONAL INFORMATION
Comment 1 David Edmundson 2021-11-18 14:47:58 UTC
*** Bug 445543 has been marked as a duplicate of this bug. ***
Comment 2 Arjen Hiemstra 2021-12-03 12:27:59 UTC
Git commit 220fb2c18c37c760e671f9d33bcace9f3b4d3532 by Arjen Hiemstra.
Committed on 03/12/2021 at 12:21.
Pushed by ahiemstra into branch 'master'.

ProcessCore: Check the actual previous values when updating IO rates

During startup, we may end up updating IO rates with a previous value of
0. This leads to ridiculously large numbers. To prevent it, don't use a
global flag to track this, but check the actual previous values and
elapsed time when updating rates and ignore updates when either is <= 0.

M  +15   -13   processcore/processes.cpp

https://invent.kde.org/plasma/libksysguard/commit/220fb2c18c37c760e671f9d33bcace9f3b4d3532