add CgroupCPUUsageDocker just like CgroupCPUDocker

This commit is contained in:
Bin Liu 2018-10-19 18:44:19 +08:00 committed by liubin31
parent a11c78ba2c
commit 601dd00812
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"))
}