[SIGAR-106] Add cpu irq, soft_irq and steal

This commit is contained in:
Doug MacEachern committed 2008-05-24 15:12:06 +00:00
1 parent e3510e0805
commit 9a1f45cd7b
12 files changed
+118 -9

No files matched your search

+9 -1
View File
@@ -411,8 +411,16 @@ static void get_cpu_metrics(sigar_t *sigar, sigar_cpu_t *cpu, char *line)
if (*ptr == ' ') {
/* 2.6+ kernels only */
cpu->wait += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
cpu->irq += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
cpu->soft_irq += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
}
cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle + cpu->wait;
if (*ptr == ' ') {
/* 2.6.11+ kernels only */
cpu->steal += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
}
cpu->total =
cpu->user + cpu->nice + cpu->sys + cpu->idle +
cpu->wait + cpu->irq + cpu->soft_irq + cpu->steal;
}
int sigar_cpu_get(sigar_t *sigar, sigar_cpu_t *cpu)