Skip to content

Add documentation for docker stats --format#26892

Merged
thaJeztah merged 1 commit intomoby:masterfrom
boaz0:stats_format_docs
Sep 26, 2016
Merged

Add documentation for docker stats --format#26892
thaJeztah merged 1 commit intomoby:masterfrom
boaz0:stats_format_docs

Conversation

@boaz0
Copy link
Copy Markdown
Contributor

@boaz0 boaz0 commented Sep 25, 2016

- What I did

This closes #26779

- How I did it
Add description in the stats command line documentation

@GordonTheTurtle GordonTheTurtle added status/3-docs-review dco/no Automatically set by a bot when one of the commits lacks proper signature and removed dco/no Automatically set by a bot when one of the commits lacks proper signature labels Sep 25, 2016
Copy link
Copy Markdown
Member

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small nit, but LGTM 🐸
/cc @thaJeztah

Comment thread docs/reference/commandline/stats.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only available on Linux maybe ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's slightly better

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread docs/reference/commandline/stats.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/will pretty print/pretty prints/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/reference/commandline/stats.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nit: can you make the | align here (and for the heading)? Makes it slightly more readable when looking at the Markdown source

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/reference/commandline/stats.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to remove future tense;

When using the `--format` option, the `stats` command either
outputs the data exactly as the template declares or, when using the
`table` directive, includes column headers as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/reference/commandline/stats.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a bash language-hint, and add a space between the "command" and the "output"? We've seen that that makes it a bit clearer what the output is, and what the actually command is. Also looks like the output of your example is missing the colon; So;

```bash
$ docker stats --format "{{.Container}}: {{.CPUPerc}}"

09d3bb5b1604:        6.61%
9db7aa4d986d:        9.19%
3f214c61ad1d:        0.00%
```

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/reference/commandline/stats.md Outdated
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah Sep 25, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is > 80-chars, please wrap;

To list all containers statistics with their name, CPU percentage and memory
usage in a table format you can use:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread docs/reference/commandline/stats.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do the same here? (Bash-hint, and space between command and output)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@boaz0
Copy link
Copy Markdown
Contributor Author

boaz0 commented Sep 25, 2016

@thaJeztah @vdemeester thanks a lot!
@thaJeztah I am working now on the man page. Thanks for noticing me 😄

@boaz0
Copy link
Copy Markdown
Contributor Author

boaz0 commented Sep 26, 2016

@thaJeztah OK, I added --format to the stats man page. 🚀

Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@thaJeztah thaJeztah added this to the 1.13.0 milestone Sep 26, 2016
@thaJeztah thaJeztah merged commit c8a19ae into moby:master Sep 26, 2016
@boaz0
Copy link
Copy Markdown
Contributor Author

boaz0 commented Sep 26, 2016

@thaJeztah the pleasure is all mine! I like Docker a lot and giving back to the community is the least that I can do.

This was referenced Sep 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add documentation for docker stats --format

4 participants