engine

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

func New

func New(c config.Config, client drone.Client, fleet cluster.Cluster) *Engine

func (*Engine) Downscale

func (e *Engine) Downscale(ctx context.Context, agents []cluster.NodeId) error

func (*Engine) Plan

func (e *Engine) Plan(ctx context.Context) (*Plan, error)

Plan determines whether there is a need to upscale or downscale the agent cluster based on current capacity and build traffic

func (*Engine) Start

func (e *Engine) Start(ctx context.Context)

func (*Engine) Upscale

func (e *Engine) Upscale(ctx context.Context, count int) error

type Plan

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

Plan describes the scaling action that needs to be taken, as determined by autoscaler's planner engine. It also supplies the data required to carry out the action.

func (*Plan) MarshalJSON

func (p *Plan) MarshalJSON() ([]byte, error)

func (*Plan) NodesToDestroy

func (p *Plan) NodesToDestroy() []cluster.NodeId

NodesToDestroy returns IDs of agent machines to destroy when downscaling

func (*Plan) RequiresDownscaling

func (p *Plan) RequiresDownscaling() bool

RequiresDownscaling returns true when we have extra compute capacity that must be shed

func (*Plan) RequiresUpscaling

func (p *Plan) RequiresUpscaling() bool

RequiresUpscaling returns true when more agents must be added

func (*Plan) String

func (p *Plan) String() string

serialization methods for better representation of Plan in logs

func (*Plan) UpscaleCount

func (p *Plan) UpscaleCount() int

UpscaleCount returns the number of nodes to add to the agent cluster when upscaling

type StageFilter

type StageFilter func(stage *drone.Stage) bool

StageFilter is a filter function applied to a single drone stage

Jump to

Keyboard shortcuts

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