4f0d95fa | package daemon // import "github.com/docker/docker/daemon" |
340e5233 | import ( |
835971c6 | "runtime" |
340e5233 | "time" |
835971c6 | "github.com/docker/docker/daemon/stats" "github.com/docker/docker/pkg/system" |
340e5233 | ) // newStatsCollector returns a new statsCollector that collections // stats for a registered container at the specified interval. // The collector allows non-running containers to be added // and will start processing stats when they are started. |
835971c6 | func (daemon *Daemon) newStatsCollector(interval time.Duration) *stats.Collector { // FIXME(vdemeester) move this elsewhere if runtime.GOOS == "linux" { meminfo, err := system.ReadMemInfo() if err == nil && meminfo.MemTotal > 0 { daemon.machineMemory = uint64(meminfo.MemTotal) |
340e5233 | } } |
835971c6 | s := stats.NewCollector(daemon, interval) go s.Run() return s |
340e5233 | } |