Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Memory % in stats tab #560

Open
konsalex opened this issue Jul 5, 2024 · 1 comment
Open

Wrong Memory % in stats tab #560

konsalex opened this issue Jul 5, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@konsalex
Copy link

konsalex commented Jul 5, 2024

Describe the bug
A clear and concise description of what the bug is.

If I execute docker stats the memory percentage is fairly small ~5%, while lazydocker stats tab says its always around 100% of utilization.

To Reproduce
Steps to reproduce the behavior:

Run a docker container, and go to stats tab and compare with actual docker stats.

I reproduced it with two versions of lazydocker and two OS (macos and ubuntu).

MacOS details
Version: 0.23.3
Date:
BuildSource: homebrew
Commit:
OS: darwin
Arch: amd64
Client:
 Version:           26.1.4
 API version:       1.45
 Go version:        go1.21.11
 Git commit:        5650f9b
 Built:             Wed Jun  5 11:26:02 2024
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.31.0 (153195)
 Engine:
  Version:          26.1.4
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       de5c9cf
  Built:            Wed Jun  5 11:29:12 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.33
  GitCommit:        d2d58213f83a351ca8f528a95fbd145f5654e957
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
Ubuntu details
Version: 0.23.3
Date: 2024-05-26T04:20:34Z
BuildSource: binaryRelease
Commit: 152b36577137fd95f288e12cee5fd6d857a2d101
OS: linux
Arch: amd64

Client: Docker Engine - Community
Version: 27.0.3
API version: 1.46
Go version: go1.21.11
Git commit: 7d4bcd8
Built: Sat Jun 29 00:02:23 2024
OS/Arch: linux/amd64
Context: default

Server: Docker Engine - Community
Engine:
Version: 27.0.3
API version: 1.46 (minimum version 1.24)
Go version: go1.21.11
Git commit: 662f78c
Built: Sat Jun 29 00:02:23 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.7.18
GitCommit: ae71819c4f5e67bb4d5ae76a6b735f29cc25774e
runc:
Version: 1.7.18
GitCommit: v1.1.13-0-g58aa920
docker-init:
Version: 0.19.0
GitCommit: de40ad0

Expected behaviour

Show the correct percentage

Screenshots

CleanShot 2024-07-05 at 19 22 53@2x

Desktop (please complete the following information):

  • OS: [e.g. Windows]
  • Lazydocker Version [e.g. v0.1.45]
  • The last commit id if you built project from sources (run : git rev-parse HEAD)

Additional context

None for now, if asked I can provide more info

@konsalex konsalex added the bug Something isn't working label Jul 5, 2024
@konsalex
Copy link
Author

konsalex commented Jul 5, 2024

Could it be that the calculation does not align with how docker perform the calculation (removing the inactive_file):
https://github.com/docker/cli/blob/master/cli/command/container/stats_helpers.go#L239

If this is a reference:
https://github.com/jesseduffield/lazydocker/blob/master/pkg/commands/container_stats.go#L150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant