Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Add option to draw the CPU chart as a stacked area chart #297

Closed
andrewdbate opened this issue Jan 20, 2022 · 10 comments
Closed

Comments

@andrewdbate
Copy link
Contributor

andrewdbate commented Jan 20, 2022

I have a 6-core / 12-thread machine. When I am running a program that uses several threads and has high CPU usage (for example, compiling C++ with many worker threads or running database queries), the CPU chart in Monitor is difficult / impossible to read because the plots overlap on the plot area:
screenshot-monitor

The Gnome System Monitor offers the choice of a stacked area chart that solves this problem. Here is a screenshot:
screenshot-gnome-stacked

The Gnome System Monitor offers two options in its preferences. These are:

  • Draw CPU chart as stacked area chat, and
  • Draw CPU chart as smooth graph

Here is a screenshot of these options in the Gnome System Monitor preferences dialog:
screenshot-gnome-preferences
Here is the stacked area CPU chart from Gnome System Monitor but with smooth lines turned on:
screenshot-gnome-stacked-smooth

In my opinion, the stacked chart has several advantages:

  • You can clearly see the total CPU usage of the system (it is the top line of the chart). While Monitor does show the current total CPU utilization (see the first screenshot above), sometimes you want to see the history of the total CPU usage graphed over the several seconds (as it goes up and down), not just the current CPU usage. You can easily do this with the stacked chart.
  • It is much easier to read how a particular CPU thread has contributed to the total CPU usage over time because you can look at its "slice" in the stack. You cannot really do this when the plots are drawn on top of each other (i.e. without being stacked).
  • A stacked chart still works well with several CPU threads to plot, whereas plotting them on top of each other (as Monitor currently does, i.e. without being stacked) can become unreadable on a many-core/many-thread machine.

Of the two Gnome System Monitor screenshots above showing the stacked charts, I personally prefer the first one without the smooth lines because having less detail makes it easier to identify what is going on with only a quick glance.

I am not necessarily suggesting changing the default chart, but having a stacked chart (without smooth lines) as an option would be very welcome.

@stsdc
Copy link
Member

stsdc commented Jan 20, 2022

Didn't know that there is actually such a need. Yes I think it can be added, but needs design. I want to preserve informing of high thread usage, but it also needs to be indicated what colour a thread is on the plot.

And of course if You need "real" plot data, I have nothing against adding an option to disable smoothing.

@andrewdbate
Copy link
Contributor Author

It would be good to have an option to disable smoothing. Gnome System Monitor allows smoothing to be disabled independently of the choice of the selected chart type (either regular or stacked).

Perhaps the option to disable smoothing should be a separate issue?

@stsdc
Copy link
Member

stsdc commented Jan 20, 2022

Agree. I thought about this as a separate feature.

@andrewdbate
Copy link
Contributor Author

I have now described the option for turning off smoothing in a separate feature request #298.

So this issue should be just about implementing support for stacked CPU charts.

@stsdc
Copy link
Member

stsdc commented Feb 23, 2022

Quick PoC.

obraz

@andrewdbate
Copy link
Contributor Author

That looks really good! I think that is much easier to read!

@andrewdbate
Copy link
Contributor Author

Here is how this looks on my system (screenshot from the 0.13.0 release):
Screenshot from 2022-03-20 16 27 14

This is so much easier to read!

This might be because I have 12 cores, so lots of stacked chart areas, but because the area under each chart is drawn with alpha transparency and on top of each other, the colour seems to become brown (see arrow).

@andrewdbate
Copy link
Contributor Author

Here is a screenshot of Gnome System Monitor. On the stacked area chart, only the area that corresponds to that core is shaded:

Screenshot from 2022-03-20 17 33 08

(Although Gnome System Monitor does not use transparency, I agree that the transparency in Monitor looks better.)

I think that only the area that corresponds to each core should be shaded (instead of shading everything under the line).

That would also fix the overlapping transparency/brown colour issue.

@stsdc
Copy link
Member

stsdc commented Jan 22, 2023

Best I can do right now 😅

Zrzut ekranu z 2023-01-22 14 36 22

@stsdc stsdc closed this as completed in b1bed24 Jan 22, 2023
@stsdc stsdc reopened this Jan 22, 2023
@stsdc
Copy link
Member

stsdc commented Jan 22, 2023

Looks like it fixes issue with mixing different colors. If you think there is more to do let me know!

@stsdc stsdc closed this as completed Jan 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants