statistics

package
v1.21.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddResourceList

func AddResourceList(total corev1.ResourceList, add corev1.ResourceList)

func GetClusterTenantResourceQuota

func GetClusterTenantResourceQuota(ctx context.Context, cli client.Client) (corev1.ResourceList, error)

func ResourceListCollect

func ResourceListCollect(into, vals corev1.ResourceList, collect ResourceListCollectFunc) corev1.ResourceList

func SubResourceList

func SubResourceList(total corev1.ResourceList, sub corev1.ResourceList)

Types

type ClusterPodResourceStatistics

type ClusterPodResourceStatistics struct {
	Limit   corev1.ResourceList `json:"limit"`
	Request corev1.ResourceList `json:"request"`
}

func GetAllPodResourceStatistics

func GetAllPodResourceStatistics(ctx context.Context, cli client.Client) (ClusterPodResourceStatistics, error)

type ClusterResourceStatistics

type ClusterResourceStatistics struct {
	// 集群资源的总容量,即物理资源总量
	Capacity corev1.ResourceList `json:"capacity"`
	// 集群资源的真实使用量
	Used corev1.ResourceList `json:"used"`
	// 集群资源的真实剩余量
	Free corev1.ResourceList `json:"free"`
	// 集群下的资源分配总量
	Allocated corev1.ResourceList `json:"allocated"`
	// 集群下的租户资源分配总量
	TenantAllocated corev1.ResourceList `json:"tenantAllocated"`
	// pod资源统计
	PodResourceStats ClusterPodResourceStatistics `json:"podResourceStats"`
}

func GetClusterResourceStatistics

func GetClusterResourceStatistics(ctx context.Context, cli client.Client) ClusterResourceStatistics

type ClusterWorkloadStatistics

type ClusterWorkloadStatistics map[string]int

type ResourceListCollectFunc

type ResourceListCollectFunc func(corev1.ResourceName, *resource.Quantity, resource.Quantity)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL