Bug 468816

Summary: After disabling swap, the value of "Used Swap memory percentage" sensor is "nan%"
Product: [Frameworks and Libraries] ksystemstats Reporter: Patrick Silva <bugseforuns>
Component: GeneralAssignee: Plasma Bugs List <plasma-bugs-null>
Status: REPORTED ---    
Severity: normal CC: ahiemstra, nate, notmart
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: screenshot

Description Patrick Silva 2023-04-22 15:48:23 UTC
Created attachment 158328 [details]
screenshot

STEPS TO REPRODUCE
1. add "Memory usage" widget to desktop
2. open the widget settings, go to "sensors details", add "Used Swap memory percentage" sensor and click on "OK"
3. disable your swap by running "# swapoff /dev/sdxy", where "/dev/sdxy" is your swap partition

OBSERVED RESULT
as seen in the attached screenshot, "Used Swap memory percentage" is "nan%"

EXPECTED RESULT
replace "nan%", I'm not sure with what. Maybe "Disabled", "Not available, "Off", etc.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.105.0
Qt Version: 5.15.9
Graphics Platform: Wayland