scaler

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2019 License: LGPL-3.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 Config

type Config struct {
	Name                  string
	MinCount              uint
	MaxCount              uint
	Logger                zerolog.Logger
	MaxOpenScalingTickets uint
	WatcherInterval       time.Duration
}

Config is the configuration for the Scaler

func (Config) New

func (cfg Config) New(scalingTarget ScalingTarget, metrics Metrics) (*Scaler, error)

New creates a new instance of a scaler using the given ScalingTarget to send scaling events to.

type Metrics

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

Metrics represents the collection of metrics internally set by scaler.

func NewMetrics

func NewMetrics() Metrics

NewMetrics returns the metrics collection needed for the SAA.

type Scaler

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

Scaler is a component responsible for scaling a scalingObject

func (*Scaler) GetCount

func (s *Scaler) GetCount() (uint, error)

GetCount returns the number of currently deployed instances

func (*Scaler) GetName

func (s *Scaler) GetName() string

GetName returns the name of this component

func (*Scaler) Join

func (s *Scaler) Join()

Join blocks/ waits until scaler has been stopped

func (*Scaler) Run

func (s *Scaler) Run()

Run starts/ runs the scaler

func (*Scaler) ScaleTo

func (s *Scaler) ScaleTo(desiredCount uint, dryRun bool) error

ScaleTo will scale the scalingObject to the desired count.

func (*Scaler) Stop

func (s *Scaler) Stop()

Stop tears down scaler

type ScalingTarget

type ScalingTarget interface {
	AdjustScalingObjectCount(scalingObject string, min uint, max uint, from uint, to uint) error
	GetScalingObjectCount(scalingObject string) (uint, error)
	IsScalingObjectDead(scalingObject string) (bool, error)
	String() string
}

ScalingTarget represents the interface to be implemented in order to be used by the Scaler as scaling target.

type ScalingTicket

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

ScalingTicket represents a ticket/ scalingObject to express the whish to scale and to track the state of the scaling.

func NewScalingTicket

func NewScalingTicket(desiredCount uint, dryRun bool) ScalingTicket

NewScalingTicket creates and opens/ issues a new ScalingTicket

Jump to

Keyboard shortcuts

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