mirror of https://github.com/docker/cli.git
Allow pulling stats once and disconnecting.
Adds a `stream` query param to the stats API which allows API users to only collect one stats entry and disconnect instead of keeping the connection alive to stream more stats. Also adds a `--no-stream` flag to `docker stats` which does the same Signed-off-by: Brian Goff <cpuguy83@gmail.com>
This commit is contained in:
parent
5b8040c935
commit
485c6d868b
|
@ -1011,7 +1011,7 @@ _docker_start() {
|
|||
_docker_stats() {
|
||||
case "$cur" in
|
||||
-*)
|
||||
COMPREPLY=( $( compgen -W "--help" -- "$cur" ) )
|
||||
COMPREPLY=( $( compgen -W "--no-stream --help" -- "$cur" ) )
|
||||
;;
|
||||
*)
|
||||
__docker_containers_running
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
function __fish_docker_no_subcommand --description 'Test if docker has yet to be given the subcommand'
|
||||
for i in (commandline -opc)
|
||||
if contains -- $i attach build commit cp create diff events exec export history images import info inspect kill load login logout logs pause port ps pull push rename restart rm rmi run save search start stop tag top unpause version wait
|
||||
if contains -- $i attach build commit cp create diff events exec export history images import info inspect kill load login logout logs pause port ps pull push rename restart rm rmi run save search start stop tag top unpause version wait stats
|
||||
return 1
|
||||
end
|
||||
end
|
||||
|
@ -362,6 +362,7 @@ complete -c docker -A -f -n '__fish_seen_subcommand_from start' -a '(__fish_prin
|
|||
# stats
|
||||
complete -c docker -f -n '__fish_docker_no_subcommand' -a stats -d "Display a live stream of one or more containers' resource usage statistics"
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from stats' -l help -d 'Print usage'
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from stats' -l no-stream -d 'Disable streaming stats and only pull the first result'
|
||||
complete -c docker -A -f -n '__fish_seen_subcommand_from stats' -a '(__fish_print_docker_containers running)' -d "Container"
|
||||
|
||||
# stop
|
||||
|
|
|
@ -326,6 +326,7 @@ __docker_subcommand () {
|
|||
;;
|
||||
(stats)
|
||||
_arguments \
|
||||
'--no-stream[Disable streaming stats and only pull the first result]' \
|
||||
'*:containers:__docker_runningcontainers'
|
||||
;;
|
||||
(rm)
|
||||
|
|
|
@ -2394,6 +2394,7 @@ more details on finding shared images from the command line.
|
|||
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
|
||||
|
||||
Running `docker stats` on multiple containers
|
||||
|
||||
|
|
Loading…
Reference in New Issue