scale

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2020 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GarbageCollectionThreshold is a nano-second time, which dictates the threshold for state
	// entries to be declared stale. The current value 86400000000000 is 24 hours.
	GarbageCollectionThreshold int64 = 86400000000000
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {

	// GetLatestScalingEvents is used to pull all the currently stored latest scaling events from
	// the storage backend.
	GetLatestScalingEvents() (map[string]*state.ScalingEvent, error)

	// GetLatestScalingEvent is used to pull the latest scaling event for the particular job group
	// from the storage backend if we have a record.
	GetLatestScalingEvent(job, group string) (*state.ScalingEvent, error)

	// GetScalingEvents returns all scaling events held within the state.
	GetScalingEvents() (map[uuid.UUID]map[string]*state.ScalingEvent, error)

	// GetScalingEvent is used to find an individual event in the state.
	GetScalingEvent(id uuid.UUID) (map[string]*state.ScalingEvent, error)

	// PutScalingEvent is used to update the state with a new scaling event. When implementing this
	// function, care should be taken to ensure both the Events and LatestEvents fields are
	// manipulated.
	PutScalingEvent(string, *state.ScalingEventMessage) error

	// RunGarbageCollection triggers are run of the state event garbage collection which is used to
	// clear up old state entries. This ensures the state backend doesn't just continually grow.
	RunGarbageCollection()
}

Backend is the interface required for a state storage backend. A state storage backend is used to durably store job scaling state outside of Sherpa.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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