mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
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 <hukeping@huawei.com>
This commit is contained in:
parent
d2e7ba42b1
commit
da67833e63
1 changed files with 5 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue