topology

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2022 License: Apache-2.0 Imports: 19 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"

Variables

This section is empty.

Functions

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 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, arch string, 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 VMIHasInvTSCFeature

func VMIHasInvTSCFeature(vmi *k6tv1.VirtualMachineInstance) bool

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, err error)
	TopologyHintsRequiredForVMI(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) LowestTSCFrequencyOnCluster

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

func (*MockHinter) TSCFrequenciesInUse

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

func (*MockHinter) TopologyHintsForVMI

func (_m *MockHinter) TopologyHintsForVMI(vmi *v1.VirtualMachineInstance) (*v1.TopologyHints, error)

func (*MockHinter) TopologyHintsRequiredForVMI

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

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

Jump to

Keyboard shortcuts

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