diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-07-02 19:48:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-02 19:48:20 +0200 |
commit | 26d02e97395b2fb5ab5abdc0a35ab6019dccbe18 (patch) | |
tree | c201ff82479441d5aacff262275c74b2d28c34f1 /pkg | |
parent | 4d45d8020e58841862791796ea4c0797a62540e9 (diff) | |
parent | 856780f55288ec9e9bfae6c6a7459ca12fb61c5d (diff) | |
download | podman-26d02e97395b2fb5ab5abdc0a35ab6019dccbe18.tar.gz podman-26d02e97395b2fb5ab5abdc0a35ab6019dccbe18.tar.bz2 podman-26d02e97395b2fb5ab5abdc0a35ab6019dccbe18.zip |
Merge pull request #3471 from giuseppe/small-fixes-cgroups
cgroups v2: fix cpu time
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/cgroups/cgroups.go | 2 | ||||
-rw-r--r-- | pkg/cgroups/cpu.go | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/pkg/cgroups/cgroups.go b/pkg/cgroups/cgroups.go index 426bda559..d6c19212b 100644 --- a/pkg/cgroups/cgroups.go +++ b/pkg/cgroups/cgroups.go @@ -30,7 +30,7 @@ type CgroupControl struct { additionalControllers []controller } -// CPUUsage keeps stats for the CPU usage +// CPUUsage keeps stats for the CPU usage (unit: nanoseconds) type CPUUsage struct { Kernel uint64 Total uint64 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 { |