Docker stats
Since version 1.5, there has been a basic statistic command built into Docker:
docker stats --help Usage: docker stats [OPTIONS] CONTAINER [CONTAINER...] Display a live stream of one or more containers' resource usage statistics --help=false Print usage --no-stream=false Disable streaming stats and only pull the first result
This command will stream details of the resource utilization of your containers in real time. The best way to find out about the command is to see it in action.
Running Docker stats
Let's launch a container using the vagrant environment, which we covered in the last chapter:
[russ@mac ~]$ cd ~/Documents/Projects/monitoring-docker/vagrant-centos/ [russ@mac ~]$ vagrant up Bringing machine 'default' up with 'virtualbox' provider... ==> default: Importing base box 'russmckendrick/centos71'... ==> default: Matching MAC address for NAT networking... ==> default: Checking if box 'russmckendrick...