moby/daemon/stats
Sebastiaan van Stijn 481b8e54b4
Fix stats collector spinning CPU if no stats are collected
Commit fd0e24b718 changed
the stats collection loop to use a `sleep()` instead
of `time.Tick()` in the for-loop.

This change caused a regression in situations where
no stats are being collected, or an error is hit
in the loop (in which case the loop would `continue`,
and the `sleep()` is not hit).

This patch puts the sleep at the start of the loop
to guarantee it's always hit.

This will delay the sampling, which is similar to the
behavior before fd0e24b718.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-03-15 17:56:15 +01:00
..
collector.go Fix stats collector spinning CPU if no stats are collected 2018-03-15 17:56:15 +01:00
collector_unix.go Add canonical import comment 2018-02-05 16:51:57 -05:00
collector_windows.go Add canonical import comment 2018-02-05 16:51:57 -05:00