Merge pull request #27759 from Microsoft/jjh/fixstats

Windows: Fix stats CLI
Upstream-commit: 24285349989577af5b76de0a9b11a4e259ce6410
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2016-10-26 18:17:18 -07:00
committed by GitHub
2 changed files with 28 additions and 16 deletions

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")