scale

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2019 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Direction

type Direction string
const (
	DirectionIn  Direction = "in"
	DirectionOut Direction = "out"
)

func (*Direction) String

func (d *Direction) String() string

type GroupReq

type GroupReq struct {

	// Direction is the scaling direction which the group is requested to change.
	Direction Direction

	// Count is the number by which to change the count by in the desired direction. This
	// information can also be found within the GroupScalingPolicy, but the API and the internal
	// autoscaler have different ways in which to process data so it is their responsibility to
	// populate this field for use and moves this logic away from the trigger.
	Count int

	// GroupName is the name of the job group to scale in this request.
	GroupName string

	// GroupScalingPolicy should include the job group scaling policy if it exists within the
	// Sherpa server.
	GroupScalingPolicy *policy.GroupScalingPolicy
}

GroupReq is a single item of scaling information for a single job group.

func (*GroupReq) MarshalZerologObject

func (g *GroupReq) MarshalZerologObject(e *zerolog.Event)

type Scale

type Scale interface {
	// Trigger performs scaling of 1 or more job groups which belong to the same job.
	Trigger(string, []*GroupReq) (*api.JobRegisterResponse, int, error)
	// contains filtered or unexported methods
}

Scale is the interface used for scaling a Nomad job.

func NewScaler

func NewScaler(c *api.Client, l zerolog.Logger, strictChecking bool) Scale

type Scaler

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

func (*Scaler) Trigger

func (s *Scaler) Trigger(jobID string, groupReqs []*GroupReq) (*api.JobRegisterResponse, int, error)

Trigger performs scaling of 1 or more job groups which belong to the same job.

The return values indicate:

  • the Nomad API job register response
  • the HTTP return code, used for the Sherpa API
  • any error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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