Allow docker stats without arguments

This patch adds the ability to run `docker stats` w/o arguments and get
statistics for all running containers by default. Also add a new
`--all` flag to list statistics for all containers (like `docker ps`).
New running containers are added to the list as they show up also.
Add integration tests for this new behavior.
Docs updated accordingly. Fix missing stuff in man/commandline
reference for `docker stats`.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
Antonio Murdaca
2015-10-03 14:53:25 +02:00
committed by Antonio Murdaca
parent 7a19164c17
commit ae818a820f
6 changed files with 232 additions and 23 deletions

View File

@@ -24,7 +24,6 @@ type ContainerStatsConfig struct {
// ContainerStats writes information about the container to the stream
// given in the config object.
func (daemon *Daemon) ContainerStats(prefixOrName string, config *ContainerStatsConfig) error {
container, err := daemon.Get(prefixOrName)
if err != nil {
return err