Merge pull request #595 from liu4480/dev

add CgroupCPUUsageDocker just like CgroupCPUDocker
This commit is contained in:
shirou 2018-10-23 22:17:00 +09:00 committed by GitHub
commit 3ec50d2876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -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"))
}