From 68c879406bffe772c83643a97a3b1a6e4fba967d Mon Sep 17 00:00:00 2001 From: John Howard Date: Thu, 28 May 2015 12:21:32 -0700 Subject: [PATCH] Windows: Factor out stat collector Signed-off-by: John Howard --- ...s_collector.go => stats_collector_unix.go} | 2 ++ daemon/stats_collector_windows.go | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) rename daemon/{stats_collector.go => stats_collector_unix.go} (99%) create mode 100644 daemon/stats_collector_windows.go diff --git a/daemon/stats_collector.go b/daemon/stats_collector_unix.go similarity index 99% rename from daemon/stats_collector.go rename to daemon/stats_collector_unix.go index 98b44c3de2..7d571a428d 100644 --- a/daemon/stats_collector.go +++ b/daemon/stats_collector_unix.go @@ -1,3 +1,5 @@ +// +build !windows + package daemon import ( diff --git a/daemon/stats_collector_windows.go b/daemon/stats_collector_windows.go new file mode 100644 index 0000000000..f16d7ee380 --- /dev/null +++ b/daemon/stats_collector_windows.go @@ -0,0 +1,31 @@ +package daemon + +import "time" + +// 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. +func newStatsCollector(interval time.Duration) *statsCollector { + 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. +func (s *statsCollector) collect(c *Container) chan interface{} { + return nil +} + +// stopCollection closes the channels for all subscribers and removes +// the container from metrics collection. +func (s *statsCollector) stopCollection(c *Container) { +} + +// unsubscribe removes a specific subscriber from receiving updates for a container's stats. +func (s *statsCollector) unsubscribe(c *Container, ch chan interface{}) { +}