Add inotify watches as debug information

This commit is contained in:
Victor Marmol 2015-05-21 13:47:45 -07:00
parent 392e1be9e5
commit 1f248ee956

View File

@ -55,6 +55,23 @@ func (self *rawFactory) CanHandleAndAccept(name string) (bool, bool, error) {
return true, accept, nil
}
func (self *rawFactory) DebugInfo() map[string][]string {
out := make(map[string][]string)
// Get information about inotify watches.
watches := self.watcher.GetWatches()
lines := make([]string, 0, len(watches))
for containerName, cgroupWatches := range watches {
lines = append(lines, fmt.Sprintf("%s:", containerName))
for _, cg := range cgroupWatches {
lines = append(lines, fmt.Sprintf("\t%s", cg))
}
}
out["Inotify watches"] = lines
return out
}
func Register(machineInfoFactory info.MachineInfoFactory, fsInfo fs.FsInfo) error {
cgroupSubsystems, err := libcontainer.GetCgroupSubsystems()
if err != nil {