mirror of https://github.com/docker/docs.git
client: stats: fill in stats info on client
This code was lost in a rebase in the PIDs cgroup merge, fix it so that `docker stats` actually shows statistics from the PIDs cgroup. Signed-off-by: Aleksa Sarai <asarai@suse.com>
This commit is contained in:
parent
77f501a0c6
commit
084241a37b
|
@ -116,6 +116,7 @@ func (s *containerStats) Collect(cli client.APIClient, streamStats bool, waitFir
|
||||||
s.NetworkRx, s.NetworkTx = calculateNetwork(v.Networks)
|
s.NetworkRx, s.NetworkTx = calculateNetwork(v.Networks)
|
||||||
s.BlockRead = float64(blkRead)
|
s.BlockRead = float64(blkRead)
|
||||||
s.BlockWrite = float64(blkWrite)
|
s.BlockWrite = float64(blkWrite)
|
||||||
|
s.PidsCurrent = v.PidsStats.Current
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
u <- nil
|
u <- nil
|
||||||
if !streamStats {
|
if !streamStats {
|
||||||
|
@ -137,6 +138,7 @@ func (s *containerStats) Collect(cli client.APIClient, streamStats bool, waitFir
|
||||||
s.NetworkTx = 0
|
s.NetworkTx = 0
|
||||||
s.BlockRead = 0
|
s.BlockRead = 0
|
||||||
s.BlockWrite = 0
|
s.BlockWrite = 0
|
||||||
|
s.PidsCurrent = 0
|
||||||
s.mu.Unlock()
|
s.mu.Unlock()
|
||||||
// if this is the first stat you get, release WaitGroup
|
// if this is the first stat you get, release WaitGroup
|
||||||
if !getFirst {
|
if !getFirst {
|
||||||
|
|
Loading…
Reference in New Issue