schedule

package
v0.0.0-...-e3441d1 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fake

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

Fake is a fake scheduler.

func NewFake

func NewFake() *Fake

NewFake returns a fake scheduler.

func (*Fake) GetBuildlet

func (f *Fake) GetBuildlet(ctx context.Context, si *queue.SchedItem) (buildlet.Client, error)

GetBuildlet returns a fake buildlet client for the requested buildlet.

func (*Fake) State

func (f *Fake) State() (st SchedulerState)

State returns the state of the fake scheduler.

func (*Fake) WaiterState

func (f *Fake) WaiterState(waiter *queue.SchedItem) (ws types.BuildletWaitStatus)

WaiterState is the waiter state of the fake scheduler.

type Scheduler

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

The Scheduler prioritizes access to buidlets. It accepts requests for buildlets, starts the creation of buildlets from BuildletPools, and prioritizes which callers gets them first when they're ready.

func NewScheduler

func NewScheduler() *Scheduler

NewScheduler returns a new scheduler.

func (*Scheduler) GetBuildlet

func (s *Scheduler) GetBuildlet(ctx context.Context, si *queue.SchedItem) (buildlet.Client, error)

GetBuildlet requests a buildlet with the parameters described in si.

The provided si must be newly allocated; ownership passes to the scheduler.

func (*Scheduler) State

func (s *Scheduler) State() (st SchedulerState)

func (*Scheduler) WaiterState

func (s *Scheduler) WaiterState(waiter *queue.SchedItem) (ws types.BuildletWaitStatus)

WaiterState returns tells waiter how many callers are on the line in front of them.

type SchedulerHostState

type SchedulerHostState struct {
	HostType     string
	LastProgress time.Duration
	Total        SchedulerWaitingState
	Gomote       SchedulerWaitingState
	Try          SchedulerWaitingState
	Regular      SchedulerWaitingState
}

type SchedulerState

type SchedulerState struct {
	HostTypes []SchedulerHostState
}

type SchedulerWaitingState

type SchedulerWaitingState struct {
	Count  int
	Newest time.Duration
	Oldest time.Duration
}

type Span

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

Span is an event covering a region of time. A Span ultimately ends in an error or success, and will eventually be visualized and logged.

func CreateSpan

func CreateSpan(el pool.EventTimeLogger, event string, optText ...string) *Span

CreateSpan creates a span with the appropriate metadata. It also starts the span.

func (*Span) Done

func (s *Span) Done(err error) error

Done ends a span. It is legal to call Done multiple times. Only the first call logs. Done always returns its input argument.

func (*Span) End

func (s *Span) End() time.Time

End is the end time for an span.

func (*Span) Event

func (s *Span) Event() string

Event is the span's event.

func (*Span) OptText

func (s *Span) OptText() string

OptText is the optional text for a span.

func (*Span) Start

func (s *Span) Start() time.Time

Start is the start time for the span.

type Spanner

type Spanner interface {
	SpanRecord(*Span, error) *types.SpanRecord
}

Jump to

Keyboard shortcuts

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