diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-08-13 01:36:07 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-08-13 01:36:07 +0000 |
commit | 83f71d0127993889486eafd9221b5229e1f7f982 (patch) | |
tree | d0681df13f0067fffd19a38793f846b6f761ab5b /runsc/container | |
parent | 1e598212a50aa7bee03a47cf6c5f3b23254d64ab (diff) | |
parent | ddcf884e9d396930095ab1fde51b14201e8cf718 (diff) |
Merge release-20210806.0-22-gddcf884e9 (automated)
Diffstat (limited to 'runsc/container')
-rw-r--r-- | runsc/container/container.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go index d1f979eb2..381f57574 100644 --- a/runsc/container/container.go +++ b/runsc/container/container.go @@ -652,6 +652,24 @@ func (c *Container) Cat(files []string, out *os.File) error { return c.Sandbox.Cat(c.ID, files, out) } +// Usage displays memory used by the application. +func (c *Container) Usage(full bool) (control.MemoryUsage, error) { + log.Debugf("Usage in container, cid: %s, full: %v", c.ID, full) + return c.Sandbox.Usage(c.ID, full) +} + +// UsageFD shows application memory usage using two donated FDs. +func (c *Container) UsageFD() (*control.MemoryUsageRecord, error) { + log.Debugf("UsageFD in container, cid: %s", c.ID) + return c.Sandbox.UsageFD(c.ID) +} + +// Reduce requests that the sentry attempt to reduce its memory usage. +func (c *Container) Reduce(wait bool) error { + log.Debugf("Reduce in container, cid: %s", c.ID) + return c.Sandbox.Reduce(c.ID, wait) +} + // State returns the metadata of the container. func (c *Container) State() specs.State { return specs.State{ |