GNOME Bugzilla – Bug 308148
Don't show processor usage before computed
Last modified: 2011-11-11 10:03:55 UTC
Currently, the processor usage is set to 0 until it is computing. This led me to the belief that sys-mon couldn't provide that data, until I noticed that it took a second. Thus, that column should be blank until the data can be provided. Other information:
I'm afrait this is impossible. As the cpu% is an int column. If not set, default is 0. Look, to get a process cpu usage, you need to do (cpu_time - last_cpu_time). So on startup, as g-s-m doesn't have last_cpu_time, it cannont compute cpu% on startup. you need to wait the first refresh. OK ?
Hmm, this is still an annoying usablity bug, even if it is not easy to fix.
this can't be fixed. There have to be 2 polls to approximate cpu%. And with a fast refresh time, you get cpu time quickly.
the current code does the following: STEP 1 for each process : - create a new ProcInfo - get process info - insert row into the process tree STEP 2 on every update : for each process : - update process info - update the row the first update occurs a few seconds (depends on user preferences) after the STEP 1. In the first step, when the row is inserted, cpu% is OK. I tried to turn the first step to: STEP 1bis for each process : - create a new ProcInfo - get process cpu time - get process info - {cpu time} - update process cpu time and compute cpu% - insert row into the process tree As "- get process info - {cpu time}" is not very fast (i mean a few ms, probably less, i mean not immediate), i was expecting to be able to compute cpu% before inserting the row in the tree. But it looks like that linux updates process info (available through /proc) not that fast. So on the the "- update process cpu time and compute cpu%" cpu times are unchanged which leads again to cpu% = 0. I see no way to fix this.
And there is no way to keep the column blank?
no.
Well that sucks. Is there another way we can get around this bug?
Corey Burger > I don't really see a bug here. You can wait 1 second and you see the beginning of the blue line and you understand quickly. IMHO, this bug can be closed as WONTFIX.
yep
Lionel, you are looking at the wrong tab. I am speaking of the column of zeros in the first tab. These show up before the cpu is computed and thus lead to the false impression that nothing is using any cpu. Think of this as similar to not drawing the window until all the pieces are in place (I am not advocating that we wait until the cpu is computed before drawing the window, just making the comparison)
Corey > I'm sorry, I didn't understand. Well, now I understand better what you mean. But, really, it doesn't hurt me at all to see a few zeroes during 1/2 second.
I have pinged the Usablity list about this one. The reason I filed this bug was that for the longest time I thought that sys-mon couldn't do cpu usage, because it *seemed* like it stayed at zero all the time.
Try CVS HEAD, the bug is somehow fixed because of #310248
Maybe the column could be made to visually hint that it is not computed? For example make it look disabled by setting foreground color to greyish until the value has actually been computed.