Skip to content

Instantly share code, notes, and snippets.

@zinovyev
Created September 28, 2018 12:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zinovyev/db45a6e0e73346786cd2226df2dc75ce to your computer and use it in GitHub Desktop.
Save zinovyev/db45a6e0e73346786cd2226df2dc75ce to your computer and use it in GitHub Desktop.
Output docker stats as json
docker stats --no-stream --no-trunc --format '{ "container": "{{ .Container }}", "name": "{{ .Name }}", "id": "{{ .ID }}", "cpu_perc": "{{ .CPUPerc }}", "mem_usage": "{{ .MemUsage }}", "net_io": "{{ .NetIO }}", "block_io": "{{ .BlockIO }}", "mem_perc": "{{ .MemPerc }}", "pids": "{{ .PIDs }}" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment