Support the 'guest_nice' cpu mode of /proc/stat.
'guest_nice' is available since Linux 2.6.33.
This commit is contained in:
parent
636c88adf7
commit
45ca8db352
2 changed files with 9 additions and 1 deletions
|
|
@ -104,7 +104,7 @@ func (c *statCollector) Update(ch chan<- prometheus.Metric) error {
|
|||
break
|
||||
}
|
||||
// Only some of these may be present, depending on kernel version.
|
||||
cpuFields := []string{"user", "nice", "system", "idle", "iowait", "irq", "softirq", "steal", "guest"}
|
||||
cpuFields := []string{"user", "nice", "system", "idle", "iowait", "irq", "softirq", "steal", "guest", "guest_nice"}
|
||||
// OpenVZ guests lack the "guest" CPU field, which needs to be ignored.
|
||||
expectedFieldNum := len(cpuFields) + 1
|
||||
if expectedFieldNum > len(parts) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue