Add SwapStats to NodeStats, PodStats and ContainerStats

Signed-off-by: Itamar Holder <iholder@redhat.com>

Kubernetes-commit: a05d200ac8961ec29c8eebab46ca1fa249061a2f
This commit is contained in:
Itamar Holder 2023-06-27 12:43:02 +03:00 committed by Kubernetes Publisher
parent cc40de8a1f
commit 9b6eb9c3a9
1 changed files with 22 additions and 0 deletions

View File

@ -59,6 +59,9 @@ type NodeStats struct {
// Stats about the rlimit of system.
// +optional
Rlimit *RlimitStats `json:"rlimit,omitempty"`
// Stats pertaining to swap resources. This is reported to non-windows systems only.
// +optional
Swap *SwapStats `json:"swap,omitempty"`
}
// RlimitStats are stats rlimit of OS.
@ -131,6 +134,9 @@ type PodStats struct {
// ProcessStats pertaining to processes.
// +optional
ProcessStats *ProcessStats `json:"process_stats,omitempty"`
// Stats pertaining to swap resources. This is reported to non-windows systems only.
// +optional
Swap *SwapStats `json:"swap,omitempty"`
}
// ContainerStats holds container-level unprocessed sample stats.
@ -159,6 +165,9 @@ type ContainerStats struct {
// +patchMergeKey=name
// +patchStrategy=merge
UserDefinedMetrics []UserDefinedMetric `json:"userDefinedMetrics,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
// Stats pertaining to swap resources. This is reported to non-windows systems only.
// +optional
Swap *SwapStats `json:"swap,omitempty"`
}
// PodReference contains enough information to locate the referenced pod.
@ -237,6 +246,19 @@ type MemoryStats struct {
MajorPageFaults *uint64 `json:"majorPageFaults,omitempty"`
}
// SwapStats contains data about memory usage
type SwapStats struct {
// The time at which these stats were updated.
Time metav1.Time `json:"time"`
// Available swap memory for use. This is defined as the <swap-limit> - <current-swap-usage>.
// If swap limit is undefined, this value is omitted.
// +optional
SwapAvailableBytes *uint64 `json:"swapAvailableBytes,omitempty"`
// Total swap memory in use.
// +optional
SwapUsageBytes *uint64 `json:"swapUsageBytes,omitempty"`
}
// AcceleratorStats contains stats for accelerators attached to the container.
type AcceleratorStats struct {
// Make of the accelerator (nvidia, amd, google etc.)