diff --git a/pkg/apis/stats/v1alpha1/types.go b/pkg/apis/stats/v1alpha1/types.go index b63a17a..5e8553f 100644 --- a/pkg/apis/stats/v1alpha1/types.go +++ b/pkg/apis/stats/v1alpha1/types.go @@ -46,6 +46,9 @@ type NodeStats struct { // Stats pertaining to memory (RAM) resources. // +optional Memory *MemoryStats `json:"memory,omitempty"` + // Stats pertaining to IO resources. + // +optional + IO *IOStats `json:"io,omitempty"` // Stats pertaining to network resources. // +optional Network *NetworkStats `json:"network,omitempty"` @@ -127,6 +130,9 @@ type PodStats struct { // Stats pertaining to memory (RAM) resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead). // +optional Memory *MemoryStats `json:"memory,omitempty"` + // Stats pertaining to IO resources consumed by pod cgroup (which includes all containers' resource usage and pod overhead). + // +optional + IO *IOStats `json:"io,omitempty"` // Stats pertaining to network resources. // +optional Network *NetworkStats `json:"network,omitempty"` @@ -159,6 +165,9 @@ type ContainerStats struct { // Stats pertaining to memory (RAM) resources. // +optional Memory *MemoryStats `json:"memory,omitempty"` + // Stats pertaining to IO resources. + // +optional + IO *IOStats `json:"io,omitempty"` // Metrics for Accelerators. Each Accelerator corresponds to one element in the array. Accelerators []AcceleratorStats `json:"accelerators,omitempty"` // Stats pertaining to container rootfs usage of filesystem resources. @@ -225,6 +234,9 @@ type CPUStats struct { // Cumulative CPU usage (sum of all cores) since object creation. // +optional UsageCoreNanoSeconds *uint64 `json:"usageCoreNanoSeconds,omitempty"` + // CPU PSI stats. + // +optional + PSI *PSIStats `json:"psi,omitempty"` } // MemoryStats contains data about memory usage. @@ -252,6 +264,39 @@ type MemoryStats struct { // Cumulative number of major page faults. // +optional MajorPageFaults *uint64 `json:"majorPageFaults,omitempty"` + // Memory PSI stats. + // +optional + PSI *PSIStats `json:"psi,omitempty"` +} + +// IOStats contains data about IO usage. +type IOStats struct { + // The time at which these stats were updated. + Time metav1.Time `json:"time"` + // IO PSI stats. + // +optional + PSI *PSIStats `json:"psi,omitempty"` +} + +// PSI statistics for an individual resource. +type PSIStats struct { + // PSI data for all tasks in the cgroup. + Full PSIData `json:"full"` + // PSI data for some tasks in the cgroup. + Some PSIData `json:"some"` +} + +// PSI data for an individual resource. +type PSIData struct { + // Total time duration for tasks in the cgroup have waited due to congestion. + // Unit: nanoseconds. + Total uint64 `json:"total"` + // The average (in %) tasks have waited due to congestion over a 10 second window. + Avg10 float64 `json:"avg10"` + // The average (in %) tasks have waited due to congestion over a 60 second window. + Avg60 float64 `json:"avg60"` + // The average (in %) tasks have waited due to congestion over a 300 second window. + Avg300 float64 `json:"avg300"` } // SwapStats contains data about memory usage