Forrest logo
back to the docker tool

docker:tldr:fa371

docker: Display a live stream of statistics for a space-separated list of containers.
$ docker stats ${container_name}
try on your machine

The command "docker stats ${container_name}" is used to display the live resource usage statistics of a specific Docker container.

Here's a breakdown of the command:

  • "docker stats": This is the base command to view the statistics of Docker containers.
  • "${container_name}": This is a placeholder for the actual name or ID of the container you want to monitor. You need to replace "${container_name}" with the specific name or ID of the container you want to check.

When you run this command, Docker will continuously display real-time information about the specified container. The statistics include:

  • CPU Usage: The percentage of CPU resources being used by the container.
  • Memory Usage: The amount of memory being used by the container.
  • CPU Usage Percentage: The percentage of available CPU resources being utilized by the container.
  • Memory Usage Percentage: The percentage of available memory being utilized by the container.
  • Network I/O: The amount of data being sent and received over the network by the container.
  • Block I/O: The amount of data being read from and written to block devices (such as hard disks) by the container.
  • PIDs: The number of processes running inside the container.

This information is useful for monitoring the performance and resource consumption of a specific container, and it can help you identify any bottlenecks or issues that need attention.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the docker tool