jobparser

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: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreatePodWithLimitsAndReq

func CreatePodWithLimitsAndReq(podinfo PodMemory, memRequestFactor float64) *v1.Pod

func CreatePodWithoutResources

func CreatePodWithoutResources(podinfo PodMemory) *v1.Pod

func GetJobResourceLimit

func GetJobResourceLimit() v1.ResourceList

func GetJobResourceRequest

func GetJobResourceRequest(size string) v1.ResourceList

func GetJobResourceRequestWithFactor

func GetJobResourceRequestWithFactor(size string, factor float64) v1.ResourceList

func GetJobResources

func GetJobResources(size string) v1.ResourceRequirements

func GetJobResourcesWithRequest

func GetJobResourcesWithRequest(req v1.ResourceList) v1.ResourceRequirements

func GetJobSizeFromName

func GetJobSizeFromName(name string) (string, error)

func GetPodRequest

func GetPodRequest(memSize string) v1.ResourceRequirements

func SetStartTime

func SetStartTime(pod *PodMemory) error

func ShiftTimestamps

func ShiftTimestamps(records []Record, shift time.Duration)

func SortPodMemoriesByTime

func SortPodMemoriesByTime(podMemory []PodMemory)

func UpdateJobForMigration

func UpdateJobForMigration(podinfo *PodMemory, migrationStart, migrationFinish time.Time)

is called at starting time of migration. name is updated when migration finished

func UpdateJobNameForMigration

func UpdateJobNameForMigration(podinfo *PodMemory)

Types

type Iterator

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

func NewIterator

func NewIterator(jobs []PodMemory) *Iterator

func (*Iterator) ExistNext

func (it *Iterator) ExistNext() bool

func (*Iterator) Next

func (it *Iterator) Next() bool

func (*Iterator) Push

func (it *Iterator) Push(job *PodMemory)

func (*Iterator) RemainingValues

func (it *Iterator) RemainingValues() int

func (*Iterator) Value

func (it *Iterator) Value() PodMemory

type JobData

type JobData struct {
	Name   string  `json:"Name"`
	Memory []int64 `json:"Memory"`
	Time   []int64 `json:"Time"`
}

type JobDeleter

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

func NewJobDeleterWithEndtime

func NewJobDeleterWithEndtime(jobs []PodMemory, endTime time.Time) *JobDeleter

func (*JobDeleter) Submit

func (s *JobDeleter) Submit(
	currentTime clock.Clock,
	_ algorithm.NodeLister,
	met metrics.Metrics) ([]submitter.Event, error)

type JobSubmitter

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

func NewJobSubmitter

func NewJobSubmitter(jobs []PodMemory) *JobSubmitter

func NewJobSubmitterFromFile

func NewJobSubmitterFromFile(podMemCsvFile io.Reader) *JobSubmitter

func NewJobSubmitterWithFactory

func NewJobSubmitterWithFactory(jobs []PodMemory, podfactory PodFactory) *JobSubmitter

func (*JobSubmitter) Submit

func (s *JobSubmitter) Submit(
	currentTime clock.Clock,
	_ algorithm.NodeLister,
	met metrics.Metrics) ([]submitter.Event, error)

type PodFactory

type PodFactory struct {
	SetResources  bool
	RequestFactor float64
}

func NewPodFactory

func NewPodFactory(requestFactor float64) PodFactory

func (PodFactory) New

func (f PodFactory) New(podinfo PodMemory) *v1.Pod

func (PodFactory) NewMigratedPod

func (f PodFactory) NewMigratedPod(podinfo PodMemory) *v1.Pod

func (PodFactory) NewMigratedPodToNode

func (f PodFactory) NewMigratedPodToNode(podinfo PodMemory) *v1.Pod

func (PodFactory) NewWithResources

func (f PodFactory) NewWithResources(podinfo PodMemory, memSize string) *v1.Pod

type PodMemory

type PodMemory struct {
	Name              string
	Records           []Record
	StartAt           time.Time
	EndAt             time.Time
	IsMigratingToNode string
	// contains filtered or unexported fields
}

func FindJob

func FindJob(name string, jobs []PodMemory) *PodMemory

func GetJob

func GetJob(name string, jobs []PodMemory) *PodMemory

func ParsePodMemories

func ParsePodMemories(f io.Reader) []PodMemory

func ParsePodMemoriesFromJson

func ParsePodMemoriesFromJson(reader io.Reader) ([]PodMemory, error)

func (*PodMemory) FinishedMigration

func (p *PodMemory) FinishedMigration()

func (PodMemory) IsMigrating

func (p PodMemory) IsMigrating() bool

func (*PodMemory) StartMigration

func (p *PodMemory) StartMigration()

type Record

type Record struct {
	Time  time.Time
	Usage int64
}

func FilterRecordsBefore

func FilterRecordsBefore(podmem []Record, t time.Time) []Record

type Time

type Time interface {
	Before(u Time) bool
	After(u Time) bool
}

Jump to

Keyboard shortcuts

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