topology

package
v1.0.0-beta.0 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const TSCFrequencyLabel = virtv1.CPUTimerLabel + "tsc-frequency"
View Source
const TSCFrequencySchedulingLabel = "scheduling.node.kubevirt.io/tsc-frequency"
View Source
const TSCScalableLabel = virtv1.CPUTimerLabel + "tsc-scalable"
View Source
const TSCTolerancePPM float64 = 250

Variables

This section is empty.

Functions

func AreTSCFrequencyTopologyHintsDefined added in v0.56.0

func AreTSCFrequencyTopologyHintsDefined(vmi *k6tv1.VirtualMachineInstance) bool

func CalculateTSCLabelDiff

func CalculateTSCLabelDiff(frequenciesInUse []int64, frequenciesOnNode []int64, nodeFrequency int64, scalable bool) (toAdd []int64, toRemove []int64)

func FilterNodesFromCache

func FilterNodesFromCache(objs []interface{}, predicates ...FilterPredicateFunc) []*v1.Node

func HasInvTSCFrequency

func HasInvTSCFrequency(node *v1.Node) bool

func IsManualTSCFrequencyRequired added in v0.56.0

func IsManualTSCFrequencyRequired(vmi *k6tv1.VirtualMachineInstance) bool

func IsSchedulable

func IsSchedulable(node *v1.Node) bool

func LowestTSCFrequency

func LowestTSCFrequency(nodes []*v1.Node) int64

func NewTopologyHinter

func NewTopologyHinter(nodeStore cache.Store, vmiStore cache.Store, clusterConfig *virtconfig.ClusterConfig) *topologyHinter

func TSCFrequenciesOnNode

func TSCFrequenciesOnNode(node *v1.Node) (frequencies []int64)

func TSCFrequencyFromNode

func TSCFrequencyFromNode(node *v1.Node) (frequency int64, scalable bool, err error)

func TSCFrequencyFromPod

func TSCFrequencyFromPod(pod *v1.Pod) (frequency int64, err error)

func ToTSCSchedulableLabel

func ToTSCSchedulableLabel(frequency int64) string

func ToTSCSchedulableLabels

func ToTSCSchedulableLabels(frequencies []int64) (labels []string)

func ToleranceForFrequency added in v0.58.2

func ToleranceForFrequency(freq int64) int64

ToleranceForFrequency returns TSCTolerancePPM parts per million of freq, rounded down to the nearest Hz

Types

type FilterPredicateFunc

type FilterPredicateFunc func(node *v1.Node) bool

func TSCFrequencyGreaterEqual

func TSCFrequencyGreaterEqual(frequency int64) FilterPredicateFunc

type Hinter

type Hinter interface {
	TopologyHintsForVMI(vmi *k6tv1.VirtualMachineInstance) (hints *k6tv1.TopologyHints, requirement TscFrequencyRequirementType, err error)
	IsTscFrequencyRequired(vmi *k6tv1.VirtualMachineInstance) bool
	TSCFrequenciesInUse() []int64
	LowestTSCFrequencyOnCluster() (int64, error)
}

type MockHinter

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

Mock of Hinter interface

func NewMockHinter

func NewMockHinter(ctrl *gomock.Controller) *MockHinter

func (*MockHinter) EXPECT

func (_m *MockHinter) EXPECT() *_MockHinterRecorder

func (*MockHinter) IsTscFrequencyRequired added in v0.58.1

func (_m *MockHinter) IsTscFrequencyRequired(vmi *v1.VirtualMachineInstance) bool

func (*MockHinter) LowestTSCFrequencyOnCluster

func (_m *MockHinter) LowestTSCFrequencyOnCluster() (int64, error)

func (*MockHinter) TSCFrequenciesInUse

func (_m *MockHinter) TSCFrequenciesInUse() []int64

func (*MockHinter) TopologyHintsForVMI

type MockNodeTopologyUpdater

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

Mock of NodeTopologyUpdater interface

func NewMockNodeTopologyUpdater

func NewMockNodeTopologyUpdater(ctrl *gomock.Controller) *MockNodeTopologyUpdater

func (*MockNodeTopologyUpdater) EXPECT

func (_m *MockNodeTopologyUpdater) EXPECT() *_MockNodeTopologyUpdaterRecorder

func (*MockNodeTopologyUpdater) Run

func (_m *MockNodeTopologyUpdater) Run(interval time.Duration, stopChan <-chan struct{})

type NodeTopologyUpdater

type NodeTopologyUpdater interface {
	Run(interval time.Duration, stopChan <-chan struct{})
}

func NewNodeTopologyUpdater

func NewNodeTopologyUpdater(clientset kubecli.KubevirtClient, hinter Hinter, nodeInformer cache.SharedIndexInformer) NodeTopologyUpdater

type TscFrequencyRequirement added in v0.56.1

type TscFrequencyRequirement struct {
	Type   TscFrequencyRequirementType
	Reason string
}

func GetTscFrequencyRequirement added in v0.56.1

func GetTscFrequencyRequirement(vmi *k6tv1.VirtualMachineInstance) TscFrequencyRequirement

type TscFrequencyRequirementType added in v0.56.1

type TscFrequencyRequirementType int
const (
	RequiredForBoot TscFrequencyRequirementType = iota
	RequiredForMigration
	NotRequired
)

Jump to

Keyboard shortcuts

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