From 2c9e907912821712242c9daa8a7ae9c7c64b1c01 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Fri, 1 Nov 2019 20:51:24 +0100 Subject: cgroups: read correctly the CPU stats the two values were incorrectly switched. Signed-off-by: Giuseppe Scrivano --- pkg/cgroups/cpu.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/cgroups/cpu.go b/pkg/cgroups/cpu.go index 03677f1ef..a43a76b22 100644 --- a/pkg/cgroups/cpu.go +++ b/pkg/cgroups/cpu.go @@ -81,14 +81,14 @@ func (c *cpuHandler) Stat(ctr *CgroupControl, m *Metrics) error { return err } if val, found := values["usage_usec"]; found { - usage.Kernel, err = strconv.ParseUint(cleanString(val[0]), 10, 0) + usage.Total, err = strconv.ParseUint(cleanString(val[0]), 10, 0) if err != nil { return err } usage.Kernel *= 1000 } if val, found := values["system_usec"]; found { - usage.Total, err = strconv.ParseUint(cleanString(val[0]), 10, 0) + usage.Kernel, err = strconv.ParseUint(cleanString(val[0]), 10, 0) if err != nil { return err } -- cgit v1.2.3-54-g00ecf