summaryrefslogtreecommitdiff
path: root/pkg/cgroups/cpu.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2019-07-02 12:50:15 +0200
committerGiuseppe Scrivano <gscrivan@redhat.com>2019-07-02 12:59:26 +0200
commit7423426f73f367cd4e9246eb1fb1b6ac1ed33644 (patch)
treee584da6df22b92f76169d8da0eaea1032ed6e2fb /pkg/cgroups/cpu.go
parent3b9ce8a3accdc906fb0c6c51e61556c26fbc9a43 (diff)
downloadpodman-7423426f73f367cd4e9246eb1fb1b6ac1ed33644.tar.gz
podman-7423426f73f367cd4e9246eb1fb1b6ac1ed33644.tar.bz2
podman-7423426f73f367cd4e9246eb1fb1b6ac1ed33644.zip
cgroups: fix times conversion
convert the time we read in microseconds to nanoseconds. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/cgroups/cpu.go')
-rw-r--r--pkg/cgroups/cpu.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/cgroups/cpu.go b/pkg/cgroups/cpu.go
index 3f969fd3c..8640d490e 100644
--- a/pkg/cgroups/cpu.go
+++ b/pkg/cgroups/cpu.go
@@ -85,12 +85,14 @@ func (c *cpuHandler) Stat(ctr *CgroupControl, m *Metrics) error {
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)
if err != nil {
return err
}
+ usage.Total *= 1000
}
// FIXME: How to read usage.PerCPU?
} else {