bashtop
bashtop copied to clipboard
[REQUEST] Docker container stats
Is your feature request related to a problem? Please describe. It would be great if bashtop could also display docker containers and their cpu/mem usage or even better combined stats for all containers. Turning this on/off via config or parameters would be nice to save space if the machine does not run docker containers.
Describe the solution you'd like See docker container overview cpu and memory usage to not have to split a tmux pane and reduce the full screen height
Describe alternatives you've considered None.
Additional context This is the best htop/gotop replacement out there.
Sure, it's doable. But will not be high priority on the todo's unless a lot of people want this.
That's not a bad idea, docker stats can be used to gather container stats, also with options to show all or only running containers, also filter witch containers to show.
However docker requires permissions to run as user.
bcicen/ctop can be used as example
Looks like it could be more difficult then i thought. docker stats --no-stream has a quite a delay since it samples when running so would be a very slow way to poll data and would essentially halt any keyboard input for 1 second at the lowest end. Could maybe run it in background if no other options is available, but would lag behind realtime statistics. ctop looks to be strictly interactive so no data polling possible. docker ps shows no cpu or mem usage.
We need a better way to poll cpu and mem usage for running containers.
However docker requires permissions to run as user.
Yeah would require bashtop to be run with sudo or as root.
take a look at lazydocker. something similar showing a list of running containers might be nice.
You can use the Docker API to connect directly to the service with https://docs.docker.com/engine/api/v1.41/#operation/ContainerStats