Bug 436300 - More disk usage reported in Plasma System Monitor then what other tools report
Summary: More disk usage reported in Plasma System Monitor then what other tools report
Status: REOPENED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 5.21.4
Platform: Manjaro Linux
: NOR minor
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-28 10:25 UTC by omano
Modified: 2021-07-10 00:11 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description omano 2021-04-28 10:25:10 UTC
Seems like there is a slight difference in the free space reported in Disks in Overview page, compared to manually calculating from the output of tools like "df -H". Seems like Plasma System Monitor reports more disk usage than what is manually calculated.


STEPS TO REPRODUCE
1. Open the Overview page of Plasma System Monitor and check Disk usage
2. Calculate manually your disk usage from output of "df- H" command
3. Note the difference of around 4%

OBSERVED RESULT
Monitor reports more disk usage

EXPECTED RESULT
Monitor reports accurate disk usage

SOFTWARE/OS VERSIONS
Linux: 5.10.32
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
There may be an explanation but so far I didn't find exactly how Plasma System Monitor calculates the disk usage. If someone can share the details about that it could help find the culprit, if this is not intended.
Comment 1 David Redondo 2021-04-29 07:21:12 UTC
We should report the same usage as for example as Dolphin ("Properties") of the disk, could you confirm that it's the same?
Comment 2 David Edmundson 2021-04-29 13:50:38 UTC
Marking as wait for info

Can you also include the output of both, and confirm both are using the same units
Comment 3 omano 2021-04-29 15:01:27 UTC
I could but Disks in Overview is a percentage it doesn't list any value. Hence the part where I explain the calculation of "df -H" output.
Comment 4 omano 2021-04-29 17:17:16 UTC
Can you tell me how it calculates Disks in Overview page? I have multiple disks, half of them being mounted. What should I expect from Disks in Overview page? What does it calculate?

Here are some more info, I actually found more issues:

Initial state two disks mounted: https://i.imgur.com/7vplv8d.png
Second disk unmounted: https://i.imgur.com/yR2uTm6.png
Then I mount back the second disk: https://i.imgur.com/mTn3GDK.png

It doesn't make sense. I tried to restart System Monitor but result is the same.

Can you maybe try on your side to reproduce the issues?
Comment 5 Bug Janitor Service 2021-05-14 04:33:35 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 David Redondo 2021-05-27 09:40:41 UTC
Git commit 3ab65f7b8b3779772cf0e454bf15adc66a812138 by David Redondo.
Committed on 27/05/2021 at 09:40.
Pushed by davidre into branch 'master'.

Remove sensors from AggregateSensor which are no longer part of our container

When an object is removed from a container itself and its properties are still
valid but not part of the container anymore.

M  +8    -1    systemstats/AggregateSensor.cpp
M  +0    -2    systemstats/SensorObject.cpp

https://invent.kde.org/plasma/libksysguard/commit/3ab65f7b8b3779772cf0e454bf15adc66a812138
Comment 7 David Redondo 2021-05-27 09:40:48 UTC
Git commit a79cf7dfffb947d2ac5586a468db210b1f01f473 by David Redondo.
Committed on 27/05/2021 at 09:40.
Pushed by davidre into branch 'master'.

Only add to container once the object is fully constructed

It emits the objectAdded signal of SensorContainer and listeners might
expect the object to be fully constructed at this point. For example
AggregateSensor which looks for SensorProperties that might be
added by a subclass.

M  +3    -1    systemstats/SensorObject.cpp

https://invent.kde.org/plasma/libksysguard/commit/a79cf7dfffb947d2ac5586a468db210b1f01f473
Comment 8 David Redondo 2021-05-27 09:41:11 UTC
Git commit 4f1c48237d3d890d2ff0820ab82d0f32603aeab6 by David Redondo.
Committed on 27/05/2021 at 09:41.
Pushed by davidre into branch 'Plasma/5.22'.

Remove sensors from AggregateSensor which are no longer part of our container

When an object is removed from a container itself and its properties are still
valid but not part of the container anymore.


(cherry picked from commit 3ab65f7b8b3779772cf0e454bf15adc66a812138)

M  +8    -1    systemstats/AggregateSensor.cpp

https://invent.kde.org/plasma/libksysguard/commit/4f1c48237d3d890d2ff0820ab82d0f32603aeab6
Comment 9 omano 2021-07-10 00:11:57 UTC
How is the disk usage supposed to be counted, please answer so I can verify it works, because currently it seems it doesn't.

If I unmount all drives but one, and restart System Monitor, then it keeps the previous disk usage (which is not correct anyway). If I mount all my drives, still kinda the same but different, it adds a wrong ammount to used/total, and when I unmount all these freshly mounted drives, then it stick with the new wrong value...

SOFTWARE/OS VERSIONS
Linux: 5.12.15-1
KDE Plasma Version: 5.22.3
KDE Frameworks Version: 5.83
Qt Version: 5.15.2