From 5be2b08002c8c421f35559884353a13670813f53 Mon Sep 17 00:00:00 2001 From: Hu Keping Date: Fri, 18 Sep 2015 15:24:13 +0800 Subject: [PATCH] Reset data of stats in docker cli when container stopped When use `docker stats` to minitor a running container and then stop it, there are some fields need to be reset to zero. Otherwise it will keep displaying the data it received last time. Signed-off-by: Hu Keping Upstream-commit: da67833e63f317d8f20ffed5c3250f442900bdae Component: engine --- components/engine/api/client/stats.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/engine/api/client/stats.go b/components/engine/api/client/stats.go index 896358c70b..569385326d 100644 --- a/components/engine/api/client/stats.go +++ b/components/engine/api/client/stats.go @@ -99,6 +99,11 @@ func (s *containerStats) Collect(cli *DockerCli, streamStats bool) { s.CPUPercentage = 0 s.Memory = 0 s.MemoryPercentage = 0 + s.MemoryLimit = 0 + s.NetworkRx = 0 + s.NetworkTx = 0 + s.BlockRead = 0 + s.BlockWrite = 0 s.mu.Unlock() case err := <-u: if err != nil {