2015-05-28 19:21:32 +00:00
|
|
|
package daemon
|
|
|
|
|
2015-11-12 19:55:17 +00:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/docker/docker/container"
|
|
|
|
)
|
2015-05-28 19:21:32 +00:00
|
|
|
|
|
|
|
// newStatsCollector returns a new statsCollector for collection 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.
|
2015-11-03 19:25:22 +00:00
|
|
|
func (daemon *Daemon) newStatsCollector(interval time.Duration) *statsCollector {
|
2015-05-28 19:21:32 +00:00
|
|
|
return &statsCollector{}
|
|
|
|
}
|
|
|
|
|
|
|
|
// statsCollector manages and provides container resource stats
|
|
|
|
type statsCollector struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
// collect registers the container with the collector and adds it to
|
|
|
|
// the event loop for collection on the specified interval returning
|
|
|
|
// a channel for the subscriber to receive on.
|
2015-11-12 19:55:17 +00:00
|
|
|
func (s *statsCollector) collect(c *container.Container) chan interface{} {
|
2015-05-28 19:21:32 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// stopCollection closes the channels for all subscribers and removes
|
|
|
|
// the container from metrics collection.
|
2015-11-12 19:55:17 +00:00
|
|
|
func (s *statsCollector) stopCollection(c *container.Container) {
|
2015-05-28 19:21:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// unsubscribe removes a specific subscriber from receiving updates for a container's stats.
|
2015-11-12 19:55:17 +00:00
|
|
|
func (s *statsCollector) unsubscribe(c *container.Container, ch chan interface{}) {
|
2015-05-28 19:21:32 +00:00
|
|
|
}
|