helper

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

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 used to estimate non-reclaimed pods CPU usage. If reclaimEnable is true, it will estimate reclaimed pods CPU usage.

func EstimateContainerMemoryUsage

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

EstimateContainerMemoryUsage used to estimate non-reclaimed pods memory usage. If reclaim disabled or metrics missed, memory usage will be regarded as Pod memory requests.

func EstimateUtilBasedCapacity

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 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.

func PodPerformanceScore

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

Types

type PIDController

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

func NewPIDController

func NewPIDController(params types.FirstOrderPIDParams) *PIDController

func (*PIDController) Adjust

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

func (*PIDController) SetEssentials

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

type UtilBasedCapacityOptions

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

UtilBasedCapacityOptions are options for estimate util based resource capacity

Jump to

Keyboard shortcuts

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