Windows: Fix stats CLI

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard
2016-10-25 19:57:47 -07:00
parent d5d520f0d7
commit dff7842790
2 changed files with 28 additions and 16 deletions
+10 -1
View File
@@ -80,6 +80,16 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
}
}
// Get the daemonOSType if not set already
if daemonOSType == "" {
svctx := context.Background()
sv, err := dockerCli.Client().ServerVersion(svctx)
if err != nil {
return err
}
daemonOSType = sv.Os
}
// waitFirst is a WaitGroup to wait first stat data's reach for each container
waitFirst := &sync.WaitGroup{}
@@ -184,7 +194,6 @@ func runStats(dockerCli *command.DockerCli, opts *statsOptions) error {
Output: dockerCli.Out(),
Format: formatter.NewStatsFormat(f, daemonOSType),
}
cleanScreen := func() {
if !opts.noStream {
fmt.Fprint(dockerCli.Out(), "\033[2J")