mirror of
https://github.com/containers/podman.git
synced 2025-12-03 03:39:44 +08:00
Update containerd/cgroups repo fix perf issue
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
17
vendor/github.com/containerd/cgroups/cpuacct.go
generated
vendored
17
vendor/github.com/containerd/cgroups/cpuacct.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user