From a1204a50b79dab091600e4e624aba7ce3b09a354 Mon Sep 17 00:00:00 2001 From: Pieter E Smit Date: Mon, 13 Dec 2021 11:39:33 +1300 Subject: [PATCH] Update stats.md add example json output Signed-off-by: Pieter E Smit --- docs/reference/commandline/stats.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/reference/commandline/stats.md b/docs/reference/commandline/stats.md index b4fe62d0b6..0c08903079 100644 --- a/docs/reference/commandline/stats.md +++ b/docs/reference/commandline/stats.md @@ -85,6 +85,13 @@ b95a83497c91 awesome_brattain 0.28% 5.629MiB / 1.952GiB 67b2525d8ad1 foobar 0.00% 1.727MiB / 1.952GiB 0.09% 2.48kB / 0B 4.11MB / 0B 2 ``` +Running `docker stats` on container with name nginx and getting output in `json` format. + +```console +$ docker stats nginx --no-stream --format "{{ json . }}" +{"BlockIO":"0B / 13.3kB","CPUPerc":"0.03%","Container":"nginx","ID":"ed37317fbf42","MemPerc":"0.24%","MemUsage":"2.352MiB / 982.5MiB","Name":"nginx","NetIO":"539kB / 606kB","PIDs":"2"} +``` + Running `docker stats` with customized format on all (Running and Stopped) containers. ```console