prioritymultiplier

package
v0.16.8-patch1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

Types

type Provider

type Provider interface {
	Ready() bool
	Multiplier(pool, queue string) (float64, error)
}

Provider provides per-pool-per-queue priority multipliers These can be used to increase the priority of a given queue over its base level

func NewNoOpProvider

func NewNoOpProvider() Provider

func NewStaticProvider

func NewStaticProvider(multipliers map[multiplierKey]float64) Provider

type ServiceProvider

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

ServiceProvider is an implementation of Provider that fetches priority multipliers from the Priority Multiplier Service. We cache the multipliers in memory so that we can continue scheduling even if the API is unavailable

func NewServiceProvider

func NewServiceProvider(apiClient priorityoverride.PriorityMultiplierServiceClient, updateFrequency time.Duration) *ServiceProvider

func (*ServiceProvider) Multiplier

func (p *ServiceProvider) Multiplier(pool, queue string) (float64, error)

func (*ServiceProvider) Ready

func (p *ServiceProvider) Ready() bool

func (*ServiceProvider) Run

type StaticProvider

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

StaticProvider is Provider that loads priority overrides from a static map

func (*StaticProvider) Multiplier

func (s *StaticProvider) Multiplier(pool, queue string) (float64, error)

func (*StaticProvider) Ready

func (s *StaticProvider) Ready() bool

Jump to

Keyboard shortcuts

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