summaryrefslogtreecommitdiff
path: root/pkg/cgroups
diff options
context:
space:
mode:
authorGiuseppe Scrivano <giuseppe@scrivano.org>2019-11-01 20:51:24 +0100
committerGiuseppe Scrivano <giuseppe@scrivano.org>2019-11-01 20:51:24 +0100
commit2c9e907912821712242c9daa8a7ae9c7c64b1c01 (patch)
tree01a36cf82a0c1ccdda24dcd4c34c238cd8c42f40 /pkg/cgroups
parent04e8bf3dba50e079278ac33b43ecc2ebb8f4a156 (diff)
downloadpodman-2c9e907912821712242c9daa8a7ae9c7c64b1c01.tar.gz
podman-2c9e907912821712242c9daa8a7ae9c7c64b1c01.tar.bz2
podman-2c9e907912821712242c9daa8a7ae9c7c64b1c01.zip
cgroups: read correctly the CPU stats
the two values were incorrectly switched. Signed-off-by: Giuseppe Scrivano <giuseppe@scrivano.org>
Diffstat (limited to 'pkg/cgroups')
-rw-r--r--pkg/cgroups/cpu.go4
1 files changed, 2 insertions, 2 deletions
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
}