scaler

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2019 License: LGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 Option added in v0.0.10

type Option func(c *Scaler)

Option represents an option for the Scaler

func DryRunMode added in v0.0.10

func DryRunMode(enable bool) Option

DryRunMode can be used to activate/ deactivate the dry run mode. In dry run mode no automatic scaling will executed. For more information see ../doc/DryRunMode.md

func MaxOpenScalingTickets added in v0.0.10

func MaxOpenScalingTickets(num uint) Option

MaxOpenScalingTickets specifies how many scaling tickets can be open at the same time

func WatcherInterval added in v0.0.10

func WatcherInterval(interval time.Duration) Option

WatcherInterval specifies the interval the scaleObjectWatcher will use to check if the scale still matches the current expectation

func WithLogger added in v0.0.10

func WithLogger(logger zerolog.Logger) Option

WithLogger adds a configured Logger to the Scaler

type Scaler

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

Scaler is a component responsible for scaling a scalingObject

func New added in v0.0.10

func New(scalingTarget ScalingTarget, scalingObject ScalingObject, metrics Metrics, options ...Option) (*Scaler, error)

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

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) GetTimeOfLastScaleAction added in v0.0.10

func (s *Scaler) GetTimeOfLastScaleAction() time.Time

GetTimeOfLastScaleAction returns that point in time where the most recent scaling STARTED.

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, force bool) error

ScaleTo will scale the scalingObject to the desired count.

func (*Scaler) Stop

func (s *Scaler) Stop() error

Stop tears down scaler

type ScalingObject added in v0.0.10

type ScalingObject struct {
	Name     string
	MinCount uint
	MaxCount uint
}

ScalingObject config of the ScalingObject to be scaled

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, force 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