Add initial framework for stats
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
d9e8fe62cb
commit
2290eaaccd
4 changed files with 33 additions and 1 deletions
|
@ -13,6 +13,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/docker/containerd/runtime"
|
||||
"github.com/opencontainers/runc/libcontainer"
|
||||
|
@ -304,6 +305,18 @@ func (c *libcontainerContainer) SetExited(status int) {
|
|||
c.exited = true
|
||||
}
|
||||
|
||||
func (c *libcontainerContainer) Stats() (*runtime.Stat, error) {
|
||||
now := time.Now()
|
||||
stats, err := c.c.Stats()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &runtime.Stat{
|
||||
Timestamp: now,
|
||||
Data: stats,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (c *libcontainerContainer) Delete() error {
|
||||
return c.c.Destroy()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue