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 308148 - Don't show processor usage before computed
Don't show processor usage before computed
Status: RESOLVED NOTABUG
Product: system-monitor
Classification: Core
Component: general
git master
Other All
: Normal minor
: ---
Assigned To: System-monitor maintainers
System-monitor maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-18 03:20 UTC by Corey Burger
Modified: 2011-11-11 10:03 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12



Description Corey Burger 2005-06-18 03:20:44 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:
Comment 1 Benoît Dejean 2005-06-20 16:47:15 UTC
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 ?
Comment 2 Corey Burger 2005-06-20 16:53:31 UTC
Hmm, this is still an annoying usablity bug, even if it is not easy to fix.
Comment 3 Benoît Dejean 2005-06-20 17:05:16 UTC
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.
Comment 4 Benoît Dejean 2005-06-21 16:16:13 UTC
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.
Comment 5 Corey Burger 2005-06-21 19:34:48 UTC
And there is no way to keep the column blank?
Comment 6 Benoît Dejean 2005-06-21 21:11:17 UTC
no.
Comment 7 Corey Burger 2005-06-21 21:18:01 UTC
Well that sucks.

Is there another way we can get around this bug?
Comment 8 Lionel Dricot 2005-07-21 10:58:20 UTC
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.
Comment 9 Benoît Dejean 2005-07-21 11:03:33 UTC
yep
Comment 10 Corey Burger 2005-07-21 11:06:18 UTC
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)
Comment 11 Lionel Dricot 2005-07-21 11:23:05 UTC
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. 
Comment 12 Corey Burger 2005-07-21 11:30:49 UTC
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.
Comment 13 Benoît Dejean 2005-07-21 11:38:12 UTC
Try CVS HEAD, the bug is somehow fixed because of #310248
Comment 14 Kalle Vahlman 2005-07-21 12:10:07 UTC
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.