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

Sorting issue in containers #3098

Open
atb00ker opened this issue Jan 29, 2025 · 0 comments
Open

Sorting issue in containers #3098

atb00ker opened this issue Jan 29, 2025 · 0 comments

Comments

@atb00ker
Copy link

atb00ker commented Jan 29, 2025

Describe the bug

When I have the following setting:

[containers]
all=True

I am seeing the exited containers in the list, but the exited containers mess up the sorting.
Example, when I sort with memory used, I see:

B	running	58 mins	0	100.5M	11.6G	0	0	864b	0b	/usr/local/bin/entrypoint.sh
A	running	58 mins	0	41.5M	11.6G	0	0	864b	0b	/usr/local/bin/entrypoint.sh
C	exited		NaN	?	-	-	-	NaNb	NaNb	[ "/init" ]
D	running	a week	0	365M	11.6G	0	0	920b	80b	/init
E	running	58 mins	0	100.5M	11.6G	0	0	864b	0b	/usr/local/bin/entrypoint.sh
F	exited		NaN	?	-	-	-	NaNb	NaNb	/usr/local/bin/entrypoint.sh
H	running	a week	0	592M	11.6G	0	0	864b	0b	/usr/local/bin/entrypoint.sh
G	running	58 mins	0	100.5M	11.6G	0	0	864b	0b	/usr/local/bin/entrypoint.sh

To Reproduce
Steps to reproduce the behavior:

  1. Start glances with following options:
[containers]
all=True
  1. Run, say, 5 containers, let say containers are named as followed: A, B, C, D, E
    Note: (naming is important because alphabetically sorting is messing things):

  2. Stop the container C

  3. Sort on Memory usage.
    Note that container A and B will be sorted and container D and E will be sorted.
    But they wouldn't show proper sorting among each other, i.e if D consumes more memory than A it will still be below C because value of C is ? and it alphabetically sorted itself to the position.

Expected behavior

I would expect an exited container to consume 0 memory and CPU and sort itself accordingly at the bottom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants