[SIGAR-19] Change cpu time units to milliseconds

This commit is contained in:
Doug MacEachern committed 2006-12-04 18:22:51 +00:00
1 parent 46d43d99b8
commit 70cefa7c18
4 files changed
+34 -34

No files matched your search

+5 -5
View File
@@ -423,13 +423,13 @@ static void get_cpu_metrics(sigar_t *sigar, sigar_cpu_t *cpu, char *line)
{
char *ptr = sigar_skip_token(line); /* "cpu%d" */
cpu->user += SIGAR_TICK2SEC(sigar_strtoull(ptr));
cpu->nice += SIGAR_TICK2SEC(sigar_strtoull(ptr));
cpu->sys += SIGAR_TICK2SEC(sigar_strtoull(ptr));
cpu->idle += SIGAR_TICK2SEC(sigar_strtoull(ptr));
cpu->user += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
cpu->nice += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
cpu->sys += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
cpu->idle += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
if (*ptr == ' ') {
/* 2.6+ kernels only */
cpu->wait += SIGAR_TICK2SEC(sigar_strtoull(ptr));
cpu->wait += SIGAR_TICK2MSEC(sigar_strtoull(ptr));
}
cpu->total = cpu->user + cpu->nice + cpu->sys + cpu->idle + cpu->wait;
}