|
|
@ -3,7 +3,6 @@
|
|
|
|
package docker
|
|
|
|
package docker
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
"os"
|
|
|
|
"os/exec"
|
|
|
|
"os/exec"
|
|
|
@ -52,11 +51,6 @@ func GetDockerStat() ([]CgroupDockerStat, error) {
|
|
|
|
return ret, nil
|
|
|
|
return ret, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c CgroupDockerStat) String() string {
|
|
|
|
|
|
|
|
s, _ := json.Marshal(c)
|
|
|
|
|
|
|
|
return string(s)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GetDockerIDList returnes a list of DockerID.
|
|
|
|
// GetDockerIDList returnes a list of DockerID.
|
|
|
|
// This requires certain permission.
|
|
|
|
// This requires certain permission.
|
|
|
|
func GetDockerIDList() ([]string, error) {
|
|
|
|
func GetDockerIDList() ([]string, error) {
|
|
|
@ -220,11 +214,6 @@ func CgroupMemDocker(containerID string) (*CgroupMemStat, error) {
|
|
|
|
return CgroupMem(containerID, common.HostSys("fs/cgroup/memory/docker"))
|
|
|
|
return CgroupMem(containerID, common.HostSys("fs/cgroup/memory/docker"))
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (m CgroupMemStat) String() string {
|
|
|
|
|
|
|
|
s, _ := json.Marshal(m)
|
|
|
|
|
|
|
|
return string(s)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// getCgroupFilePath constructs file path to get targetted stats file.
|
|
|
|
// getCgroupFilePath constructs file path to get targetted stats file.
|
|
|
|
func getCgroupFilePath(containerID, base, target, file string) string {
|
|
|
|
func getCgroupFilePath(containerID, base, target, file string) string {
|
|
|
|
if len(base) == 0 {
|
|
|
|
if len(base) == 0 {
|
|
|
|