stats

The stats command provides real-time information on either the specified container or, if you don't pass a container name or ID, all running containers:

$ docker container stats nginx-test

As you can see from the following Terminal output, we are given information on the CPU, RAM, NETWORK, and DISK IO for the specified container:

We can also pass the -a flag; this is short for --all and displays all containers, running or not:

However, as you can see from the preceding output, if the container isn't running, there aren't any resources being utilized, so it doesn't really add any value other than giving you a visual representation of how many containers you have running and where the resources are being used.

It is also worth pointing out that the information displayed by the stats command is real-time only; Docker does not record the resource utilization and make it available in the same way that the logs command does.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset