docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
34.15k stars 5.25k forks source link

Docker stats aggregated on project #12321

Open feyst opened 1 week ago

feyst commented 1 week ago

Description

We currently have several ways to get the CPU and memory consumption for containers. We have docker stats that tells the resource usage per container. There is the docker compose stats that tells the resource usage in a particular project but there is no real way to get the resource usage per composer project. I also don't know what the command should be called but it would show a list of compose projects similar to docker compose ls but then show the same metrics as docker stats and docker compose stats but then aggregated per project.

glours commented 1 week ago

Hello @feyst Using the -p flag to specify the project name like docker compose -p your-project stats should do the job, no? Or do you what to display all resources consumption for all projects at once?

feyst commented 1 week ago

Hello @feyst Using the -p flag to specify the project name like docker compose -p your-project stats should do the job, no? Or do you what to display all resources consumption for all projects at once?

Thanks for your quick reply. The -p allows you to see the stats of a single project and not aggregated. I would like to see the stats of all projects but aggregated by project. For example If I had 2 projects with 3 containers each I would get 2 lines, one for each project stating the resources that project uses combined over all containers.

ndeloof commented 6 days ago

The sole "cross project" command we support for now is docker compose ls I wonder how we could tweak the stats command UX to support this need.