From 8c4a5b0f65be9da25560f7469ec4be10fe075409 Mon Sep 17 00:00:00 2001 From: Siavash Safi Date: Tue, 14 Jul 2015 17:27:20 +0430 Subject: [PATCH] stats: Fix formatting. --- collector/stat_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collector/stat_linux.go b/collector/stat_linux.go index 4f7241e5..80ceb3d8 100644 --- a/collector/stat_linux.go +++ b/collector/stat_linux.go @@ -98,11 +98,11 @@ func (c *statCollector) Update(ch chan<- prometheus.Metric) (err error) { // Only some of these may be present, depending on kernel version. cpuFields := []string{"user", "nice", "system", "idle", "iowait", "irq", "softirq", "steal", "guest"} // OpenVZ guests lack the "guest" CPU field, which needs to be ignored. - expectedFieldNum := len(cpuFields)+1 + expectedFieldNum := len(cpuFields) + 1 if expectedFieldNum > len(parts) { expectedFieldNum = len(parts) } - for i, v := range parts[1 : expectedFieldNum] { + for i, v := range parts[1:expectedFieldNum] { value, err := strconv.ParseFloat(v, 64) if err != nil { return err