docker / cli

The Docker CLI
Apache License 2.0
4.9k stars 1.92k forks source link

docker stats only yielding peak values for NET I/O and BLOCK I/O #4108

Open briankim1512 opened 1 year ago

briankim1512 commented 1 year ago

Description

When polling docker stats, I noticed that the NET I/O and BLOCK I/O stats never changed from their values. Upon further investigation, it seems that these two stats only displayed peak stats ever recorded on those containers.

Reproduce

  1. docker stats

Expected behavior

docker stats should be showing the current NET I/O and BLOCK I/O stats rather than peak.

docker version

Client: Docker Engine - Community
 Version:           23.0.1
 API version:       1.42
 Go version:        go1.19.5
 Git commit:        a5ee5b1
 Built:             Thu Feb  9 19:46:49 2023
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          23.0.1
  API version:      1.42 (minimum version 1.12)
  Go version:       go1.19.5
  Git commit:       bc3805a
  Built:            Thu Feb  9 19:46:49 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.18
  GitCommit:        2456e983eb9e37e47538f59ea18f2043c9a73640
 nvidia:
  Version:          1.1.4
  GitCommit:        v1.1.4-0-g5fd4c4d
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.10.2
    Path:     /usr/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.16.0
    Path:     /usr/libexec/docker/cli-plugins/docker-compose
  scan: Docker Scan (Docker Inc.)
    Version:  v0.23.0
    Path:     /usr/libexec/docker/cli-plugins/docker-scan

Server:
 Containers: 25
  Running: 6
  Paused: 0
  Stopped: 19
 Images: 109
 Server Version: 23.0.1
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 nvidia runc
 Default Runtime: nvidia
 Init Binary: docker-init
 containerd version: 2456e983eb9e37e47538f59ea18f2043c9a73640
 runc version: v1.1.4-0-g5fd4c4d
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
 Kernel Version: 5.4.0-42-generic
 Operating System: Ubuntu 18.04.6 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 20
 Total Memory: 188.4GiB
 Name: basic
 ID: PRZK:UVZJ:ML3A:GIRS:7R2P:C2VV:XD7C:XTMS:EXPD:NGWW:DFCS:KSV2
 Docker Root Dir: /var/lib/docker_xfs_nvme
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No swap limit support

Additional Info

No response

Pivnoy commented 1 year ago

Hello, I would like to work on this issue, if it still open and actual.

briankim1512 commented 1 year ago

This issue is still replicable in my environment and the issue is still open. You're welcome to open a new pull request unless otherwise stated by those maintaining this repo

Pivnoy commented 1 year ago

I will make a pull request and start working on the issue