helper

package
v0.5.10 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2024 License: Apache-2.0 Imports: 16 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimateContainerCPUUsage

func EstimateContainerCPUUsage(ci *types.ContainerInfo, metaReader metacache.MetaReader, reclaimEnable bool) (float64, error)

EstimateContainerCPUUsage estimates non-reclaimed container cpu usage. Use cpu request if metrics are missing or reclaimEnable is false.

func EstimateContainerMemoryUsage

func EstimateContainerMemoryUsage(ci *types.ContainerInfo, metaReader metacache.MetaReader, reclaimEnable bool) (float64, error)

EstimateContainerMemoryUsage estimates non-reclaimed container memory usage. Use memory request if metrics are missing or reclaimEnable is false.

func EstimateUtilBasedCapacity added in v0.3.0

func EstimateUtilBasedCapacity(options UtilBasedCapacityOptions, resourceSupply,
	currentUtilization, lastCapacityResult float64,
) (float64, error)

EstimateUtilBasedCapacity capacity by taking into account the difference between the current and target resource utilization of the workload pool

func GetAvailableNUMAsAndReclaimedCores added in v0.4.0

func GetAvailableNUMAsAndReclaimedCores(conf *config.Configuration, metaReader metacache.MetaReader, metaServer *metaserver.MetaServer) (machine.CPUSet, []*types.ContainerInfo, error)

func IsValidQosLevel added in v0.5.1

func IsValidQosLevel(qoslevel string) bool

func PodEnableReclaim

func PodEnableReclaim(ctx context.Context, metaServer *metaserver.MetaServer,
	podUID string, nodeEnableReclaim bool,
) (bool, error)

PodEnableReclaim checks whether the pod can be reclaimed, if node does not enable reclaim, it will return false directly, if node enable reclaim, it will check whether the pod is degraded or baseline.

func PodIsDaemonSet added in v0.5.1

func PodIsDaemonSet(pod *v1.Pod) bool

func PodPerformanceScore added in v0.3.0

func PodPerformanceScore(ctx context.Context, metaServer *metaserver.MetaServer, podUID string) (float64, error)

Types

type PIDController added in v0.3.0

type PIDController struct {
	// contains filtered or unexported fields
}

func NewPIDController added in v0.3.0

func NewPIDController(variableName string, params types.FirstOrderPIDParams) *PIDController

func (*PIDController) Adjust added in v0.3.0

func (c *PIDController) Adjust(controlKnob, target, current float64) float64

func (*PIDController) SetEssentials added in v0.3.0

func (c *PIDController) SetEssentials(resourceEssentials types.ResourceEssentials)

type UtilBasedCapacityOptions added in v0.3.0

type UtilBasedCapacityOptions struct {
	TargetUtilization float64
	MaxUtilization    float64
	MaxOversoldRate   float64
	MaxCapacity       float64
}

UtilBasedCapacityOptions are options for estimate util based resource capacity

Directories

Path Synopsis
modelctrl

Jump to

Keyboard shortcuts

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