scorer

package
v0.0.0-...-d4c0b77 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultScorer = iota // 0
	LeftOverScorer
	EnumLeftOverScorer
)

Variables

This section is empty.

Functions

func AlwaysFoundScoreFunc

func AlwaysFoundScoreFunc(allocatable int64, usedByPod int64, usedByNode int64, requested []int64, initContainer bool) (
	found bool, score float64, usedByContainer int64, newUsedByPod, newUsedByNode int64)

AlwaysFoundScoreFunc provides something that always returns true want to make allocatable-used as close to requested

func EnumScoreFunc

func EnumScoreFunc(allocatable int64, usedByPod int64, usedByNode int64, requested []int64, initContainer bool) (
	found bool, score float64, usedByContainer int64, newUsedByPod, newUsedByNode int64)

EnumScoreFunc returns bitwise score

func LeftoverScoreFunc

func LeftoverScoreFunc(allocatable int64, usedByPod int64, usedByNode int64, requested []int64, initContainer bool) (
	found bool, score float64, usedByContainer int64, newUsedByPod, newUsedByNode int64)

LeftoverScoreFunc provides default scoring function

Types

type ResourceScoreFunc

type ResourceScoreFunc func(alloctable int64, usedByPod int64, usedByNode int64, requested []int64, initContainer bool) (bool, float64, int64, int64, int64)

func GetDefaultScorer

func GetDefaultScorer(resource types.ResourceName) ResourceScoreFunc

GetDefaultScorer returns default scorer given a name

func SetScorer

func SetScorer(resource types.ResourceName, scorerType int32) ResourceScoreFunc

Jump to

Keyboard shortcuts

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