fillin cpu.wait

This commit is contained in:
Doug MacEachern 2004-11-22 01:58:07 +00:00
parent 46ba56bc17
commit bd9a436247
1 changed files with 4 additions and 1 deletions

View File

@ -292,7 +292,10 @@ static void get_cpu_metrics(sigar_cpu_t *cpu, char *line)
cpu->nice += sigar_strtoul(ptr);
cpu->sys += sigar_strtoul(ptr);
cpu->idle += sigar_strtoul(ptr);
cpu->wait = 0; /*XXX*/
if (*ptr == ' ') {
/* 2.6+ kernels only */
cpu->wait += sigar_strtoul(ptr);
}
cpu->total += cpu->user + cpu->nice + cpu->sys + cpu->idle + cpu->wait;
}