Adding "stats" and "spec" option to nsinit binary which will print the stats and spec respectively.

Docker-DCO-1.1-Signed-off-by: Vishnu Kannan <vishnuk@google.com> (github: vishh)
This commit is contained in:
Vishnu Kannan 2014-05-30 00:23:18 +00:00
parent 1a38e6ff10
commit 3589181812
2 changed files with 48 additions and 0 deletions

View file

@ -5,6 +5,7 @@ import (
"os"
"path/filepath"
"strconv"
"syscall"
"github.com/dotcloud/docker/pkg/libcontainer/cgroups"
)
@ -49,6 +50,9 @@ func (s *cpuGroup) GetStats(d *data, stats *cgroups.Stats) error {
f, err := os.Open(filepath.Join(path, "cpu.stat"))
if err != nil {
if pathErr, ok := err.(*os.PathError); ok && pathErr.Err == syscall.ENOENT {
return nil
}
return err
}
defer f.Close()