Inaccurate CPU Load

Bug #795935 reported by tdeering on 2011-06-11
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Indicator Sysmonitor
Undecided
Unassigned

Bug Description

I was using mprime to run a stress test on my CPU today, and I noticed that indicator-sysmonitor only was reporting a 2-6% load. However, system monitor shows the expected 100% load. Let me know any debug info I can provide, because I really love this indicator!

tdeering (tomdeering7) wrote :

For information on my system and configuration, here is the output of 'sysinfo'

cacula (cacula) wrote :

same here: all 4 Cores show a ~100% load in system monitor (as expected), but indicator-sysmonitor shows only ~ 30% cpu load

Beniamin Bronisz (beniaminb) wrote :

I've had the same problem. I've edited: /usr/bin/indicator-sysmonitor (it is plain python script) and edited lines:

def _fetch_cpu(self):
        last = self.last
        current = ps.cpu_times()

        total_time_passed = sum([v-last.__dict__[k] if not isinstance(v,list) else 0 for k,v in current.__dict__.iteritems()])

        sys_time = current.system - last.system
        usr_time = current.user - last.user

        self.last = current

        if total_time_passed > 0:
            sys_percent = 100 * sys_time / total_time_passed
            usr_percent = 100 * usr_time / total_time_passed
            return sys_percent + usr_percent
        else:
            return 0

into:

def _fetch_cpu(self):
    return ps.cpu_percent(interval=0)

And it worked.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Bug attachments