orblazer / plasma-applet-resources-monitor

Plasmoid for monitoring CPU, memory, network traffic, GPUs and disks IO.
https://www.pling.com/p/2143899/
GNU General Public License v3.0
57 stars 6 forks source link

[BUG] CPU usage as text % disappears at 0% #25

Closed GM-Script-Writer-62850 closed 2 years ago

GM-Script-Writer-62850 commented 2 years ago

Describe the bug A reading of 0.0% for CPU usage does not appear in the widget, the number appearing/disappearing is distracting

To Reproduce

Steps to reproduce the behavior: have a high end enough cpu to see 0.0% usage with a DE running at idle (probably possible with a old high core count xeon)

Expected behavior Widget shows 0.0% or 0%

Screenshots

Versions (please complete the following information): Resource monitor (fork): 2.6.2 Operating System: Kubuntu 22.04 KDE Plasma Version: 5.23.4 KDE Frameworks Version: 5.89.0 Qt Version: 5.15.2 Kernel Version: 5.16.0-051600rc8-generic (64-bit) Graphics Platform: X11 Processors: 12 × AMD Ryzen 5 3600 6-Core Processor Memory: 15.6 GiB of RAM Graphics Processor: Radeon RX 580 Series

Additional context

orblazer commented 2 years ago

Hello, Could you try with the last commits for see if that has fix?

GM-Script-Writer-62850 commented 2 years ago

So about this line: // TODO: stack the graph values for eal fill percent ? eal?

applied patch, but i think i need to restart the widget to see if it works while having everything closed, do that next sunday when the next kernel update comes out

orblazer commented 2 years ago

So about this line: // TODO: stack the graph values for eal fill percent ? eal?

is an miss, its should be "real"

GM-Script-Writer-62850 commented 2 years ago

Just tested it on another system, shows '...' i would rather see '0%', '0.0%', or '<0.1%'

orblazer commented 2 years ago

Oh ok, i have just miss my basics of JavaScript :facepalm:

In JS 0 || 'string' show string' and not 0 so i have change my code and now this should work.

GM-Script-Writer-62850 commented 2 years ago

if you think that is bad try python, at least in JS and PHP we have ===

GM-Script-Writer-62850 commented 2 years ago

is this supposed to be fixed in 2.6.3? if so it is not working

orblazer commented 2 years ago

That is weird, could you check if that is still the same issue with unreleased version ?

And if not the issue has the same behavior ?

GM-Script-Writer-62850 commented 2 years ago

yea the original issue is back

orblazer commented 2 years ago

That is really strange, i don't see were its could be come instead nullish values.

Could you try to add some print (sorry i can't reproduce the issue by myself) :

  1. Add print(column, "index not found") before https://github.com/orblazer/plasma-applet-resources-monitor/blob/52c35ce47f49e679290be80c737cbd185f5f1ff7/package/contents/ui/components/SensorGraph.qml#L26
  2. Add print(column, data(index(0, column), Sensors.SensorDataModel.Name), data(index(0, column), Sensors.SensorDataModel.Value)) before https://github.com/orblazer/plasma-applet-resources-monitor/blob/52c35ce47f49e679290be80c737cbd185f5f1ff7/package/contents/ui/components/SensorGraph.qml#L29

Thanks by advance

GM-Script-Writer-62850 commented 2 years ago

qml: 0 Total Usage 0 qml: 0 Total Usage 0

Screenshot_20220111_110137

no idea how i managed to get the clock speed to show up when it was disabled

maybe you need to to this at the last stage (x==0?"0":x)

orblazer commented 2 years ago

Ok, i have found the issue its because libksysguard return empty string when is "null" value :facepalm:

So this is fixed with 2.7.0.