common

package
v0.3553.0-7.3.0-0-ce Latest Latest
Warning

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

Go to latest
Published: May 28, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitLogger

func InitLogger(appName string) log.Logger

func ScheduleTrogdorTasks

func ScheduleTrogdorTasks(logger log.Logger, taskSpecs []trogdor.TaskSpec, trogdorCoordinatorHost string)

Creates the passed in Trogdor tasks by calling the Trogdor Coordinator REST API

func ShuffleSlice

func ShuffleSlice(vals []string) []string

Fisher-Yates shuffle

func StringSliceContains

func StringSliceContains(list []string, element string) bool

func TimeToUnixMilli

func TimeToUnixMilli(t time.Time) uint64

func TrogdorAgentPodNames

func TrogdorAgentPodNames(trogdorAgentsCount int) []string

returns a slice of the Trogdor agent pod names

Types

type Duration

type Duration time.Duration

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

type SchedulableJob

type SchedulableJob struct {
	Name          string
	Duration      time.Duration
	DelayDuration time.Duration
	// contains filtered or unexported fields
}

func (*SchedulableJob) RunUntilEndOf

func (j *SchedulableJob) RunUntilEndOf(jobs []*SchedulableJob) error

RunUntilEndOf() schedules a job J to run until the latest endTime of all the given jobs

func (*SchedulableJob) ScheduleAfterJobEnd

func (j *SchedulableJob) ScheduleAfterJobEnd(jobs []*SchedulableJob) error

func (*SchedulableJob) ScheduleAfterJobStart

func (j *SchedulableJob) ScheduleAfterJobStart(jobs []*SchedulableJob) error

type Scheduler

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

func NewScheduler

func NewScheduler(baseStartTime time.Time) *Scheduler

func (*Scheduler) AddJob

func (s *Scheduler) AddJob(job *SchedulableJob)

func (*Scheduler) JobTimes

func (s *Scheduler) JobTimes(jobName string) (startTime time.Time, duration time.Duration, endTime time.Time, err error)

JobTimes() returns the time a job should start, its duration and the time at which it should end it is an error to call this function if the given job has not been added to the Scheduler and Scheduler#Schedule() has not been called

func (*Scheduler) Schedule

func (s *Scheduler) Schedule() error

Schedule() parses all of the jobs, validates/traverses the dependency graph (topology sort)

and populates each job's expected startTime and endTime

Jump to

Keyboard shortcuts

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