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:
parent
532697f32f
commit
bdeb87a090
11 changed files with 265 additions and 493 deletions
|
@ -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))
|
||||
},
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue