1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-21 18:41:03 +00:00

teach cpu.c to print steal and guest

This commit is contained in:
Helmut Grohne 2013-01-28 16:56:22 +01:00
parent 4bd77f20a5
commit 58ec362bb3

View file

@ -111,6 +111,26 @@ int cpu(int argc, char **argv) {
"irq.cdef irq,%d,/\n"
"softirq.cdef softirq,%d,/\n", ncpu, ncpu, ncpu);
}
if(extinfo >= 8) {
puts("steal.label steal\n"
"steal.draw STACK\n"
"steal.min 0");
printf("steal.max %d\n", 100 * ncpu);
puts("steal.type DERIVE\n"
"steal.info The time that a virtual CPU had runnable tasks, but the virtual CPU itself was not running");
if(scaleto100)
printf("steal.cdef steal,%d,/\n", ncpu);
}
if(extinfo >= 9) {
puts("guest.label guest\n"
"guest.draw STACK\n"
"guest.min 0");
printf("guest.max %d\n", 100 * ncpu);
puts("guest.type DERIVE\n"
"guest.info The time spent running a virtual CPU for guest operating systems under the control of the Linux kernel.");
if(scaleto100)
printf("guest.cdef guest,%d,/\n", ncpu);
}
return 0;
}
if(!strcmp(argv[1], "autoconf")) {
@ -149,6 +169,12 @@ int cpu(int argc, char **argv) {
if(!(s = strtok(NULL, " \t")))
return 0;
printf("softirq.value %ld\n", atol(s) * 100 / hz);
if(!(s = strtok(NULL, " \t")))
return 0;
printf("steal.value %ld\n", atol(s) * 100 / hz);
if(!(s = strtok(NULL, " \t")))
return 0;
printf("guest.value %ld\n", atol(s) * 100 / hz);
return 0;
}
}