migration

package
v0.0.0-...-57dc925 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNodeWithName

func GetNodeWithName(name string, nodes []*v1.Node) *v1.Node

Types

type Client

type Client struct {
	UsedMemoryMap  map[string]int64                // key: nodeName
	TotalMemoryMap map[string]int64                // key: nodeName
	PodMemoryMap   map[string]monitoring.PodMemMap // key: nodeName
	PodRuntime     map[string]int32                // key: podName
	PodExecution   map[string]int32                // key: podName
	PodMemorizer   map[string]*Memorizer[monitoring.PodMemMap]
	MemoInterval   int
}

func NewClient

func NewClient() *Client

func NewClientWithMemoStep

func NewClientWithMemoStep(memostep int) *Client

func (Client) GetExecutionTime

func (c Client) GetExecutionTime(pod string) int32

func (*Client) GetFreeMemoryNode

func (c *Client) GetFreeMemoryNode(name string) (float64, error)

func (*Client) GetFreeMemoryOfNodes

func (c *Client) GetFreeMemoryOfNodes() (monitoring.NodeFreeMemMap, error)

func (*Client) GetPodMemories

func (c *Client) GetPodMemories(node string) (monitoring.PodMemMap, error)

in Gb

func (Client) GetPodMemorySlope

func (c Client) GetPodMemorySlope(node, name, time, slopeWindow string) (float64, error)

func (Client) GetRuntime

func (c Client) GetRuntime(pod string) int32

func (Client) GetRuntimePercentage

func (c Client) GetRuntimePercentage(pod string) float64

func (*Client) UpdateNodeMetrics

func (c *Client) UpdateNodeMetrics(metrics map[string]node.Metrics)

func (*Client) UpdatePodMetric

func (c *Client) UpdatePodMetric(podname string, pd pod.Metrics)

func (*Client) UpdatePodMetrics

func (c *Client) UpdatePodMetrics(pods map[string]pod.Metrics)

type Memorizer

type Memorizer[T interface{}] struct {
	MemoInterval int

	CurrentStep int
	// contains filtered or unexported fields
}

func (*Memorizer[T]) Prior

func (m *Memorizer[T]) Prior() T

func (*Memorizer[T]) Update

func (m *Memorizer[T]) Update(data T)

func (*Memorizer[T]) Value

func (m *Memorizer[T]) Value() T

type MigrationSubmitter

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

func NewSubmitter

func NewSubmitter(controller monitoring.ControllerI) *MigrationSubmitter

func NewSubmitterWithJobs

func NewSubmitterWithJobs(controller monitoring.ControllerI, jobs []jobparser.PodMemory) *MigrationSubmitter

func NewSubmitterWithJobsWithEndTime

func NewSubmitterWithJobsWithEndTime(controller monitoring.ControllerI, jobs []jobparser.PodMemory, endTime time.Time) *MigrationSubmitter

func NewSubmitterWithJobsWithEndTimeFactory

func NewSubmitterWithJobsWithEndTimeFactory(controller monitoring.ControllerI, jobs []jobparser.PodMemory, endTime time.Time, factory jobparser.PodFactory, checker monitoring.MigrationCheckerI) *MigrationSubmitter

func (*MigrationSubmitter) Submit

func (m *MigrationSubmitter) Submit(
	currentTime clock.Clock,
	n algorithm.NodeLister,
	met metrics.Metrics) ([]submitter.Event, error)

type Unscheduler

type Unscheduler struct {
	EndTime                      clock.Clock
	ThresholdDecimal             float64
	ReschedulableDistanceDecimal float64 // condition to set unschedulable node to schedulable when decimal distance to the threshold is bigger or equal to ReschedulableDistanceDecimal
}

func (*Unscheduler) Submit

func (unsched *Unscheduler) Submit(
	currentTime clock.Clock,
	nodeLister algorithm.NodeLister,
	met metrics.Metrics) ([]submitter.Event, error)

Jump to

Keyboard shortcuts

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