summaryrefslogtreecommitdiff
path: root/vendor/github.com/containerd/cgroups/cpuacct.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-02-02 19:43:19 +0000
committerGitHub <noreply@github.com>2018-02-02 19:43:19 +0000
commit3ea23f84818a816104ccdcf6b836ac4bb3a7c366 (patch)
tree7ccc25d859c97ca2cad5282d7e0f4eb9a445c2e3 /vendor/github.com/containerd/cgroups/cpuacct.go
parenta01f708df5d378af6ff4e804464b34f7c9be2b5d (diff)
parenta417e6e0cc46593eb10d2ce3d5102df39d44b8dd (diff)
downloadpodman-3ea23f84818a816104ccdcf6b836ac4bb3a7c366.tar.gz
podman-3ea23f84818a816104ccdcf6b836ac4bb3a7c366.tar.bz2
podman-3ea23f84818a816104ccdcf6b836ac4bb3a7c366.zip
Merge pull request #284 from mheon/update_vendors
Update containerd/cgroups to fix perf issue
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
}