scale

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2019 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

func (*Backend) InvokeScaling

func (b *Backend) InvokeScaling(req *state.ScalingRequest)

InvokeScaling satisfies the InvokeScaling function on the Scale interface.

func (*Backend) OKToScale

func (b *Backend) OKToScale(req *state.ScalingRequest) (int, error)

OKToScale satisfies the OKToScale function on the Scale interface.

type BackendConfig

type BackendConfig struct {
	Provider      *serverCfg.ProviderConfig
	Logger        zerolog.Logger
	Nomad         *client.Nomad
	NodeResources resource.Handler
	ScaleState    state.ScaleBackend
	PolicyState   state.PolicyBackend
}

type Scale

type Scale interface {

	// OKToScale performs a number of safety checks to ensure the scaling request does not break
	// any policy parameters and that the request has a chance to run successfully. The int
	// returned indicates the appropriate HTTP response code, the error will contain any relevant
	// messages which describe the check that failed. If no error is returned, it can be assumed
	// that the request is OK to continue with.
	OKToScale(req *state.ScalingRequest) (int, error)

	// InvokeScaling triggers a scaling activity, all events from this point will be written to the
	// state store. The function is designed to be called asynchronously, therefore there is no
	// return.
	InvokeScaling(req *state.ScalingRequest)
}

Scale is the interface used to perform scaling checks and trigger activities.

func NewScaleBackend

func NewScaleBackend(cfg *BackendConfig) Scale

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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