Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateUtilizationOfResource ¶
func CalculateUtilizationOfResource(nodeInfo *framework.NodeInfo, resourceName apiv1.ResourceName, skipDaemonSetPods, skipMirrorPods bool, currentTime time.Time) (float64, error)
CalculateUtilizationOfResource calculates utilization of a given resource for a node.
Types ¶
type Info ¶
type Info struct { CpuUtil float64 MemUtil float64 GpuUtil float64 // Resource name of highest utilization resource ResourceName apiv1.ResourceName // Max(CpuUtil, MemUtil) or GpuUtils Utilization float64 }
Info contains utilization information for a node.
func Calculate ¶
func Calculate(nodeInfo *framework.NodeInfo, skipDaemonSetPods, skipMirrorPods bool, gpuConfig *cloudprovider.GpuConfig, currentTime time.Time) (utilInfo Info, err error)
Calculate calculates utilization of a node, defined as maximum of (cpu, memory) or gpu utilization based on if the node has GPU or not. Per resource utilization is the sum of requests for it divided by allocatable. It also returns the individual cpu, memory and gpu utilization.
Click to show internal directories.
Click to hide internal directories.