moby/daemon/stats
Brian Goff 0901d4ab31 Use condition variable to wake stats collector.
Before the collection goroutine wakes up every 1 second (as configured).
This sleep interval is in case there are no stats to collect we don't
end up in a tight loop.

Instead use a condition variable to signal that a collection is needed.
This prevents us from waking the goroutine needlessly when there is no
one looking for stats.

For now I've kept the sleep just moved it to the end of the loop, which
gives some space between collections.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
(cherry picked from commit e75e6b0e31)
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2020-02-20 11:38:16 -08:00
..
collector.go Use condition variable to wake stats collector. 2020-02-20 11:38:16 -08:00
collector_unix.go stats: avoid cgo in collector 2019-08-01 14:38:02 -07:00
collector_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00