preemptor

package
v0.0.0-...-d2b1cdf Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// PreemptionPeriod is the period to check for tasks for preemption
	PreemptionPeriod time.Duration `yaml:"preemption_period"`

	// PreemptionDequeueLimit is the limit which task preemptor get the
	// tasks
	PreemptionDequeueLimit int `yaml:"preemption_dequeue_limit"`

	// DequeuePreemptionTimeout is the timeout value for task preemptor to
	// call GetPreemptibleTasks
	DequeuePreemptionTimeout int `yaml:"preemption_dequeue_timeout_ms"`
}

Config is Task preemptor specific config

type Metrics

type Metrics struct {
	TaskPreemptSuccess tally.Counter
	TaskPreemptFail    tally.Counter

	GetPreemptibleTasks             tally.Counter
	GetPreemptibleTasksFail         tally.Counter
	GetPreemptibleTasksCallDuration tally.Timer
}

Metrics is the struct containing all the counters that track internal state of task preemptor.

func NewMetrics

func NewMetrics(scope tally.Scope) *Metrics

NewMetrics returns a new Metrics struct, with all metrics initialized and rooted at the given tally.Scope

type Preemptor

type Preemptor interface {
	// Start starts the task Preemptor goroutines
	Start() error
	// Stop stops the task Preemptor goroutines
	Stop() error
}

Preemptor defines the interface of task preemptor which kills tasks from the preemption queue of resource manager

func New

func New(
	d *yarpc.Dispatcher,
	resMgrClientName string,
	ormStore *ormobjects.Store,
	jobFactory cached.JobFactory,
	goalStateDriver goalstate.Driver,
	config *Config,
	parent tally.Scope,
) Preemptor

New create a new Task Preemptor

Jump to

Keyboard shortcuts

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