summaryrefslogtreecommitdiff
path: root/libpod/define/containerstate.go
diff options
context:
space:
mode:
authorcdoern <cbdoer23@g.holycross.edu>2021-06-11 08:35:01 -0400
committercdoern <cbdoer23@g.holycross.edu>2021-06-23 09:23:40 -0400
commitf26fa5392110c2b59cb17d4f1013cf6bb4ecd873 (patch)
tree2288c6e882a5a68b1746f543a1c367d6a2bddff2 /libpod/define/containerstate.go
parent2970e3518cc95910444903f572418f5887316e47 (diff)
downloadpodman-f26fa5392110c2b59cb17d4f1013cf6bb4ecd873.tar.gz
podman-f26fa5392110c2b59cb17d4f1013cf6bb4ecd873.tar.bz2
podman-f26fa5392110c2b59cb17d4f1013cf6bb4ecd873.zip
Podman Stats additional features
added Avg Cpu calculation and CPU up time to podman stats. Adding different feature sets in different PRs, CPU first. resolves #9258 Signed-off-by: cdoern <cbdoer23@g.holycross.edu>
Diffstat (limited to 'libpod/define/containerstate.go')
-rw-r--r--libpod/define/containerstate.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/libpod/define/containerstate.go b/libpod/define/containerstate.go
index 5d2bc9099..fc272beaa 100644
--- a/libpod/define/containerstate.go
+++ b/libpod/define/containerstate.go
@@ -1,6 +1,10 @@
package define
-import "github.com/pkg/errors"
+import (
+ "time"
+
+ "github.com/pkg/errors"
+)
// ContainerStatus represents the current state of a container
type ContainerStatus int
@@ -120,12 +124,14 @@ func (s ContainerExecStatus) String() string {
// ContainerStats contains the statistics information for a running container
type ContainerStats struct {
+ AvgCPU float64
ContainerID string
Name string
PerCPU []uint64
CPU float64
CPUNano uint64
CPUSystemNano uint64
+ DataPoints int64
SystemNano uint64
MemUsage uint64
MemLimit uint64
@@ -135,4 +141,6 @@ type ContainerStats struct {
BlockInput uint64
BlockOutput uint64
PIDs uint64
+ UpTime time.Duration
+ Duration uint64
}