Merge pull request #595 from liu4480/dev
add CgroupCPUUsageDocker just like CgroupCPUDocker
This commit is contained in:
commit
3ec50d2876
|
@ -149,6 +149,10 @@ func CgroupCPUDocker(containerid string) (*cpu.TimesStat, error) {
|
|||
return CgroupCPUDockerWithContext(context.Background(), containerid)
|
||||
}
|
||||
|
||||
func CgroupCPUUsageDocker(containerid string) (float64, error) {
|
||||
return CgroupCPUDockerUsageWithContext(context.Background(), containerid)
|
||||
}
|
||||
|
||||
func CgroupCPUDockerWithContext(ctx context.Context, containerid string) (*cpu.TimesStat, error) {
|
||||
return CgroupCPU(containerid, common.HostSys("fs/cgroup/cpuacct/docker"))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue