Implement stats for containerd

This is a single endpoint that clients will poll

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-02-11 14:36:32 -08:00
parent 532697f32f
commit bdeb87a090
11 changed files with 265 additions and 493 deletions

View file

@ -423,17 +423,15 @@ var statsCommand = cli.Command{
Id: context.Args().First(),
}
c := getClient(context)
stream, err := c.GetStats(netcontext.Background(), req)
stats, err := c.Stats(netcontext.Background(), req)
if err != nil {
fatal(err.Error(), 1)
}
for {
stats, err := stream.Recv()
if err != nil {
fatal(err.Error(), 1)
}
fmt.Println(stats)
data, err := json.Marshal(stats)
if err != nil {
fatal(err.Error(), 1)
}
fmt.Print(string(data))
},
}