summaryrefslogtreecommitdiff
path: root/libpod/define
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2022-04-28 12:31:17 -0500
committerMatthew Heon <matthew.heon@pm.me>2022-05-03 13:52:17 -0400
commit8842e9b7abde1135b2b4a7b876aa8897a624b397 (patch)
tree9f0435f4e09c2bca399ffcbaae0806dc82e42192 /libpod/define
parent6422048212572356e632e53e7a06b8ef8f7ef46f (diff)
downloadpodman-8842e9b7abde1135b2b4a7b876aa8897a624b397.tar.gz
podman-8842e9b7abde1135b2b4a7b876aa8897a624b397.tar.bz2
podman-8842e9b7abde1135b2b4a7b876aa8897a624b397.zip
Additional stats for podman info
In support of podman machine and its counterpart desktop, we have added new stats to podman info. For storage, we have added GraphRootAllocated and GraphRootUsed in bytes. For CPUs, we have added user, system, and idle percents based on /proc/stat. Fixes: #13876 Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'libpod/define')
-rw-r--r--libpod/define/info.go25
1 files changed, 19 insertions, 6 deletions
diff --git a/libpod/define/info.go b/libpod/define/info.go
index 713129ada..911fa5c03 100644
--- a/libpod/define/info.go
+++ b/libpod/define/info.go
@@ -1,6 +1,8 @@
package define
-import "github.com/containers/storage/pkg/idtools"
+import (
+ "github.com/containers/storage/pkg/idtools"
+)
// Info is the overall struct that describes the host system
// running libpod/podman
@@ -31,6 +33,7 @@ type HostInfo struct {
CgroupControllers []string `json:"cgroupControllers"`
Conmon *ConmonInfo `json:"conmon"`
CPUs int `json:"cpus"`
+ CPUUtilization *CPUUsage `json:"cpuUtilization"`
Distribution DistributionInfo `json:"distribution"`
EventLogger string `json:"eventLogger"`
Hostname string `json:"hostname"`
@@ -108,11 +111,15 @@ type StoreInfo struct {
GraphDriverName string `json:"graphDriverName"`
GraphOptions map[string]interface{} `json:"graphOptions"`
GraphRoot string `json:"graphRoot"`
- GraphStatus map[string]string `json:"graphStatus"`
- ImageCopyTmpDir string `json:"imageCopyTmpDir"`
- ImageStore ImageStore `json:"imageStore"`
- RunRoot string `json:"runRoot"`
- VolumePath string `json:"volumePath"`
+ // GraphRootAllocated is how much space the graphroot has in bytes
+ GraphRootAllocated uint64 `json:"graphRootAllocated"`
+ // GraphRootUsed is how much of graphroot is used in bytes
+ GraphRootUsed uint64 `json:"graphRootUsed"`
+ GraphStatus map[string]string `json:"graphStatus"`
+ ImageCopyTmpDir string `json:"imageCopyTmpDir"`
+ ImageStore ImageStore `json:"imageStore"`
+ RunRoot string `json:"runRoot"`
+ VolumePath string `json:"volumePath"`
}
// ImageStore describes the image store. Right now only the number
@@ -137,3 +144,9 @@ type Plugins struct {
// FIXME what should we do with Authorization, docker seems to return nothing by default
// Authorization []string `json:"authorization"`
}
+
+type CPUUsage struct {
+ UserPercent float64 `json:"userPercent"`
+ SystemPercent float64 `json:"systemPercent"`
+ IdlePercent float64 `json:"idlePercent"`
+}