Bug 450947 - Load averages in System Monitor are not rounded or truncated
Summary: Load averages in System Monitor are not rounded or truncated
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 5.24.2
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-28 03:52 UTC by AlexDeLorenzo.dev
Modified: 2023-01-13 10:10 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27
Sentry Crash Report:


Attachments
Screenshot of System Monitor's load averages (23.34 KB, image/png)
2022-02-28 03:52 UTC, AlexDeLorenzo.dev
Details
Large float values seem to cause problems with Bar/Pie Charts (16.98 KB, image/png)
2022-06-01 13:41 UTC, mjwany48
Details
Screenshot showing the problem presented in a small desktop widget (106.20 KB, image/png)
2022-12-01 11:02 UTC, Oded Arbel
Details
Another screenshot showing how this can lead to unusable widgets... (15.92 KB, image/jpeg)
2022-12-04 09:56 UTC, Mathias Homann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description AlexDeLorenzo.dev 2022-02-28 03:52:16 UTC
Created attachment 147179 [details]
Screenshot of System Monitor's load averages

SUMMARY
Load averages in System Monitor are not rounded or truncated


STEPS TO REPRODUCE
1. Open System Monitor
2. Navigate to a page with a CPU Load average text-only sensor, or add one to a page


OBSERVED RESULT
CPU Load averages will display as a float that's formatted like '1.923423423234'


EXPECTED RESULT
System Monitor should round or truncate the Load average float into something user-friendly, like '1.92'


SOFTWARE/OS VERSIONS
KDE Plasma Version: 5.24.2
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.2
Kernel Version: 5.16.11
Graphics Platform: Wayland


ADDITIONAL INFORMATION
I've attached an image that shows the issue.
Comment 1 mjwany48 2022-06-01 13:38:49 UTC
This also seems to cause some problems with Automatic Data Range, as it needs to be manually set for, as an example, Pie Charts. 

In the case of horizontal bars, where Automatic Data Range cannot be disabled, this results in a bar that is always "full" (See attached screenshot: "Screenshot of Horizontal Bars").
Comment 2 mjwany48 2022-06-01 13:41:00 UTC
Created attachment 149378 [details]
Large float values seem to cause problems with Bar/Pie Charts
Comment 3 Oded Arbel 2022-12-01 11:02:53 UTC
Created attachment 154187 [details]
Screenshot showing the problem presented in a small desktop widget

When the load average sensor is used in a small desktop widget, the Y axis label takes up more than half of the space for the line chart.

In a situation such as the one presented in the screenshot - using the "System Monitor Sensor" widget configured in "grid" mode with multiple sensors - there's a single "line chart appearance" configuration for all the widget, so you can't set an integer Y data range limit (it would fix the Y axis display for the load average but will make all the other sensors useless as their limits will not match) and removing the Y axis labels will cause all sensors to not have labels - even for those were the labels are needed.
Comment 4 Mathias Homann 2022-12-04 09:56:46 UTC
Created attachment 154300 [details]
Another screenshot showing how this can lead to unusable widgets...
Comment 5 Mathias Homann 2022-12-04 09:58:54 UTC
Personally, I don't think having more than two digits after the dot on a Loadaverage display would give any meaningful information.
Comment 6 Bug Janitor Service 2023-01-11 15:25:00 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/248
Comment 7 David Redondo 2023-01-13 10:10:23 UTC
Git commit d256da70d28a81b062ffb35f3e0d4e86808d54d8 by David Redondo.
Committed on 13/01/2023 at 10:05.
Pushed by davidre into branch 'master'.

Formatter: Format plain numbers

Do not display plain floats, instead round them nicely for presentation
FIXED-IN:5.27

M  +2    -0    formatter/Formatter.cpp

https://invent.kde.org/plasma/libksysguard/commit/d256da70d28a81b062ffb35f3e0d4e86808d54d8