pixunil / cinnamon-applet-system-monitor

An applet for Cinnamon which shows CPU, Memory and Swap usage, Disk and Network rates with graphs
http://cinnamon-spices.linuxmint.com/applets/view/198
GNU General Public License v2.0
15 stars 5 forks source link

Reported CPU usage is inaccurate. #21

Closed tsjnachos117 closed 7 years ago

tsjnachos117 commented 7 years ago

Hello, let me start off by saying thank you for this amazing applet! I've only installed it a few minuets ago, but so far I've taken quite the liking to it.

However, on my machine, this applet gives incorrect CPU usage values. More specifically, the values seem really low, no matter what I'm doing. IDK is the applet is showing averaged values or what.

I just confirmed this by converting a video with mpv (using libx264, and outputting the file to /dev/null) to raise my CPU usage. I also had the Mate System Monitor (basically, the Mate desktop's version of Gnome System Monitor) running at the same time as the applet, which showed mostly-100% CPU usage, while the applet showed 11.1% to 28.7% (I have 4 CPU cores).

This screenshot should show you exactly what I am talking about: bug

As you can see, what the applet says my CPU usage is, is completely different than what Mate System Monitor says. I know I can't encode a 720p video at 29.6 frames per second (which is what was getting, according to mpv) with so little CPU, so I know the applet is wrong. So, this leave one question: is there some misconfigured setting on my part, or have I discovered a bug?

PS: In the applet settings, I have the "Show which information in history graphs" option set to "Total usage". I suspect that has nothing to do with anything, but I though I should mention this anyway.

pixunil commented 7 years ago

I don't think that some bad settings are the fault of this bug. First, a simple question about your screenshot: Were the arcs for the cpu usage white since the installation or do you have changed settings there? Normally in the preset, they should match the colors of the system monitor. But maybe the color is just irrelevant. Also, it looks like there are only two arcs (for two cores) instead of four (like the text suggests).

Apparently, also the text is wrong so I hope that some error has occurred that is detectable. Which cinnamon version are you running? Could you please look into the log files ~/.cinnamon/glass.log and ~/.xsession-errors and post their contents? I have no problem if you only include the relevant parts for protecting your privacy.

tsjnachos117 commented 7 years ago

I have four CPU cores. I used to use another applet, but it no longer seems to work, so I installed this one, and tried to make it look like the other one. For that reason, I configured this applet so that half my cores are black, and the other half are white.

As for my version of Cinnamon, I'm running 3.2.8.

PS: I just reset the settings to their defaults, and repeated my little experiment, and that didn't solve anything. :( So I guess the colors are indeed irrelevant.

tsjnachos117 commented 7 years ago

Here are the log files you requested: Logs.zip

pixunil commented 7 years ago

Thank you. There are some new warnings I didn't detect until now and maybe one is also connected to the wrong data. I will need some time to track down he source of the problem. As for the colors, I saw only the white cores and not the black ones due to the low contrast, so I'm sure that the rendering of the graph is working correct and the data provider is wrong…

tsjnachos117 commented 7 years ago

FYI, Cinnamon 3.4.0 just came out for my distro (Ubuntu 16.04). I haven't installed it yet, but I'm about to, as soon as I backup the packages for 3.2.8.

Edit: I've upgraded to 3.4, but nothing has changed.

pixunil commented 7 years ago

Finally I could reproduce. The data provider, GTop, does deliver following cpu information: idle, user, system, nice (and some more). But the applet does only use user and system, forgetting about nice. Processes can be prioritized by a "nice" attribute. Some tasks, like compiling or converting a video, are very processor intensive, but have a low priority. As such, they are listed not under user, but in nice.

As the bugfix would be a simple extension of the applet, I will look how it should be displayed. I'll write another comment when a feature branch is available.

tsjnachos117 commented 7 years ago

Did you apply a patch already? I ask because I can't quite reproduce the bug right now. Since I just re-downloaded this applet directly from GitHub, I can only assume that either the bug was fixed, or something screwy is happening on my end.

Edit: cpu: I just noticed the "modules" directory says this: "also honor nice, iowait, irq and softirq", so I guess that answers my question.:smile:

pixunil commented 7 years ago

Yes, the patch is live in master, but not yet published in the official spices repository