CPUs load values are incorrect on Sysmonitor applet
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Screenlets |
New
|
Undecided
|
Unassigned |
Bug Description
Hello,
The CPUs load values are incorrect.
Morever screenlets.
I corrected the code directly in the applet code : here is the diff.
There is also a hack to reserve space (but only works if the applet is on the right of the screen).
34d33
< import commands
45,48d43
<
< last_total_time = [0,0,0,0]
< last_idle_time = [0,0,0,0]
<
238,245d232
< #reserve space
< print "reserve space"
< #self.window.
< self.window.
< gtk.gdk.
<
<
<
261,285d247
< def get_cpu_
< #print "truc"
< for i in range (0,self.cpu_nb):
< line = commands.
< ss = line.split();
<
< user_time = int(ss[1])
< #print str(user_time) + " " + ss[1]
< nice_time = int(ss[2])
< system_time = int(ss[3])
< idle_time = int(ss[4])
<
< idle_time = idle_time + nice_time
< total_time = idle_time + user_time + system_time
<
< total_elapsed=
< last_total_
< idle_elapsed=
< last_idle_
<
< self.cpu_load[i] = 100 - 100 * idle_elapsed / total_elapsed
< #if i==0 :
< # print self.cpu_load[i]
<
<
304,314c266,275
< self.get_
< # for i in range (0,self.cpu_nb): #Sets CPU info#
< # self.new_
< #
< # self.cpu_load[i] = self.update_
< #
< # self.old_cpu[i] = self.new_cpu[i]
< # try:
< # if self.cpu_load[i] > 99: self.cpu_load[i] = 99
< # elif self.cpu_load[i] < 0: self.cpu_load[i]=0
< # except : pass
---
> for i in range (0,self.cpu_nb): #Sets CPU info
> self.new_
>
> self.cpu_load[i] = (self.new_
>
> self.old_cpu[i] = self.new_cpu[i]
> try:
> if self.cpu_load[i] > 99: self.cpu_load[i] = 99
> elif self.cpu_load[i] < 0: self.cpu_load[i]=0
> except : pass
343c304
< #self.get_
---
> self.get_
Are you familiar with Bazaar on Launchpad? Maybe you can submit your fix yourself?