After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748999 - y axis mislabelled for cpu use when not dividing by cpu count
y axis mislabelled for cpu use when not dividing by cpu count
Status: RESOLVED FIXED
Product: system-monitor
Classification: Core
Component: resources
git master
Other All
: Normal normal
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2015-05-06 09:06 UTC by Ewan Higgs
Modified: 2016-05-19 17:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot of mislabelled axis. (27.18 KB, image/png)
2015-05-06 09:06 UTC, Ewan Higgs
  Details
Patch to properly normalise the y axis in the CPU history graph (Resources tab) (1.26 KB, patch)
2016-05-18 20:48 UTC, Guido Trentalancia
committed Details | Review

Description Ewan Higgs 2015-05-06 09:06:27 UTC
Created attachment 302961 [details]
Screenshot of mislabelled axis.

When I look at process view, I prefer to see the CPU usage as a % of individual CPU. So I uncheck the box in the preferences for dividing by cpu count. However, this makes the plot for the cpu resource use go from 0 - $(cpucount * 100). This is wrong, because each line in the CPU plot still only goes from 0-100.
Comment 1 Guido Trentalancia 2016-05-18 20:35:08 UTC
The y axis in the CPU load graph (CPU history) is not normalised properly and it is wrongly made dependent on the "divide CPU usage by CPU count" option in the Preferences.

The option "divide CPU usage by CPU count" should only affect the Processes view and not the Resources view.
Comment 2 Guido Trentalancia 2016-05-18 20:46:27 UTC
I have created a patch which fixes both problems and makes the program behave correctly.

Please see the attachment...
Comment 3 Guido Trentalancia 2016-05-18 20:48:26 UTC
Created attachment 328155 [details] [review]
Patch to properly normalise the y axis in the CPU history graph (Resources tab)

The patch applies to the latest 3.20 versions as well as to the git master. It might also apply to earlier versions.
Comment 4 Guido Trentalancia 2016-05-18 20:51:22 UTC
Could you please set Version to "git-master", OS to "All" and eventually choose an higher severity ?

Also, the patch needs to be reviewed and eventually committed.
Comment 5 Ewan Higgs 2016-05-18 20:54:11 UTC
I've made the ticket changes requested.
Comment 6 Guido Trentalancia 2016-05-18 20:57:47 UTC
Thanks Ewan !

Have you tried the patch yet ?

I have tested and it resolves the issue. Please note that the "divide CPU usage by CPU count" option refers to the Processes tab...
Comment 7 jens.timmerman 2016-05-19 10:27:33 UTC
I have tested this patch and can confirm that the axis labeling now correctly stays at 100% max with or without the dividing by cpu count checkbox marked.
Comment 8 jens.timmerman 2016-05-19 10:29:08 UTC
I tested this on top of latest master, commit ad0f1d9e6b7a252f0559bc290f18d2e5b8ce6fad
Comment 9 Guido Trentalancia 2016-05-19 14:11:41 UTC
There is no track of such commit in the git repository at https://git.gnome.org/browse/gnome-system-monitor/
Comment 11 Guido Trentalancia 2016-05-19 14:39:58 UTC
That commit is not related to this bug and the patch I submitted.
Comment 12 jens.timmerman 2016-05-19 15:33:24 UTC
excuse me for not being clear enought, 
I just meant I tested the patch on top of ad0f1d9e6b7a252f0559bc290f18d2e5b8ce6fad which is the current master, which then shows the correct results for me.
So indeed, this commit has nothing to do with the patch or the current bug, only that it is currently the latest commit in the repository I could find.
Comment 13 Guido Trentalancia 2016-05-19 15:39:34 UTC
Oh right, I understand now what you meant!

We need to have that patch committed in the git repository and possibly have a new 3.20 release created.

Unfortunately I have no write access, I hope the maintainer will be able to help...
Comment 14 Guido Trentalancia 2016-05-19 15:56:04 UTC
And thanks for testing Jens !
Comment 15 Guido Trentalancia 2016-05-19 15:58:31 UTC
I am quite sure it sorts out the wrong behaviour of the application on Ewan's machine too.
Comment 16 Guido Trentalancia 2016-05-19 16:01:31 UTC
Ewan, can you review the patch ?
Comment 17 Guido Trentalancia 2016-05-19 16:03:38 UTC
If it has not been reviewed first, they might not take it.

And since Ewan reported the bug, it's important that he reviews the patch, I suppose.
Comment 18 Robert Roth 2016-05-19 17:18:46 UTC
Attachment 328155 [details] pushed as 14b5e5d - Patch to properly normalise the y axis in the CPU history graph (Resources tab)
Comment 19 Robert Roth 2016-05-19 17:26:39 UTC
(In reply to Guido Trentalancia from comment #17)
> If it has not been reviewed first, they might not take it.
> 
> And since Ewan reported the bug, it's important that he reviews the patch, I
> suppose.

The changeset is fairly straightforward and will have the same effect on all computers, including Ewan's. I have pushed it to master. 

I am not sure when/if a new 3.20 release will be created, as even if I roll the tarballs, it depends on the distribution you are using (except if you are building from source) whether it gets to you. As this is a minor change, I would say it is perfectly ok to arrive for 3.22.

@Guido: Thanks for the proposed patch, and @Jens: thanks for the review, thanks to everyone for making System Monitor better.