diff options
author | Bernard Spil <spil.oss@gmail.com> | 2016-02-14 22:21:11 +0100 |
---|---|---|
committer | Bernard Spil <spil.oss@gmail.com> | 2016-02-14 22:21:11 +0100 |
commit | f554f08fa92f8440faa853b5fa4d588829959c8a (patch) | |
tree | c338334bdaa2bc58dc1ad1a47cd6162ce40f2f45 /freebsd | |
parent | d753996b967166b351dd1bffbc65c8c3a3b703a6 (diff) |
Fix FreeBSD CPU% calculation
Diffstat (limited to 'freebsd')
-rw-r--r-- | freebsd/Platform.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/freebsd/Platform.c b/freebsd/Platform.c index f02daa5a..4185a8b5 100644 --- a/freebsd/Platform.c +++ b/freebsd/Platform.c @@ -163,15 +163,15 @@ double Platform_setCPUValues(Meter* this, int cpu) { double percent; double* v = this->values; - v[CPU_METER_NICE] = cpuData->nicePercent; - v[CPU_METER_NORMAL] = cpuData->userPercent; + v[CPU_METER_NICE] = cpuData->nicePercent * cpus; + v[CPU_METER_NORMAL] = cpuData->userPercent * cpus; if (this->pl->settings->detailedCPUTime) { - v[CPU_METER_KERNEL] = cpuData->systemPercent; - v[CPU_METER_IRQ] = cpuData->irqPercent; + v[CPU_METER_KERNEL] = cpuData->systemPercent * cpus; + v[CPU_METER_IRQ] = cpuData->irqPercent * cpus; Meter_setItems(this, 4); percent = v[0]+v[1]+v[2]+v[3]; } else { - v[2] = cpuData->systemAllPercent; + v[2] = cpuData->systemAllPercent * cpus; Meter_setItems(this, 3); percent = v[0]+v[1]+v[2]; } |