summaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/cgroups/cpuacct.go
diff options
context:
space:
mode:
authorMatthew Heon <matthew.heon@gmail.com>2018-02-01 12:55:28 -0500
committerMatthew Heon <matthew.heon@gmail.com>2018-02-01 12:55:28 -0500
commitae89dc28d07e1c6142201c282a76d3f237821710 (patch)
treea729a757fec7c22c5df9f1f65c4cc27556005e7e /vendor/github.com/containerd/cgroups/cpuacct.go
parent03cfe5ebbee306ee4aa84c74bbff83712e50fb1c (diff)
downloadpodman-ae89dc28d07e1c6142201c282a76d3f237821710.tar.gz
podman-ae89dc28d07e1c6142201c282a76d3f237821710.tar.bz2
podman-ae89dc28d07e1c6142201c282a76d3f237821710.zip
Update containerd/cgroups repo fix perf issue
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
Diffstat (limited to 'vendor/github.com/containerd/cgroups/cpuacct.go')
-rw-r--r--vendor/github.com/containerd/cgroups/cpuacct.go17
1 files changed, 5 insertions, 12 deletions
diff --git a/vendor/github.com/containerd/cgroups/cpuacct.go b/vendor/github.com/containerd/cgroups/cpuacct.go
index 329234887..443692d21 100644
--- a/vendor/github.com/containerd/cgroups/cpuacct.go
+++ b/vendor/github.com/containerd/cgroups/cpuacct.go
@@ -30,7 +30,7 @@ func (c *cpuacctController) Path(path string) string {
return filepath.Join(c.root, path)
}
-func (c *cpuacctController) Stat(path string, stats *Stats) error {
+func (c *cpuacctController) Stat(path string, stats *Metrics) error {
user, kernel, err := c.getUsage(path)
if err != nil {
return err
@@ -43,17 +43,10 @@ func (c *cpuacctController) Stat(path string, stats *Stats) error {
if err != nil {
return err
}
- stats.cpuMu.Lock()
- cpu := stats.Cpu
- if cpu == nil {
- cpu = &CpuStat{}
- stats.Cpu = cpu
- }
- stats.cpuMu.Unlock()
- cpu.Usage.Total = total
- cpu.Usage.User = user
- cpu.Usage.Kernel = kernel
- cpu.Usage.PerCpu = percpu
+ stats.CPU.Usage.Total = total
+ stats.CPU.Usage.User = user
+ stats.CPU.Usage.Kernel = kernel
+ stats.CPU.Usage.PerCPU = percpu
return nil
}