autoscaler

package
v1.2.6 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoScaler

type AutoScaler interface {
	Estimator
	// Acquire X ResourceUnit of resource
	Acquire(ResourceUnit) error
	// Release X ResourceUnit of resource
	Release(ResourceUnit)
	// GetCurrent ResourceUnit of resource
	GetCurrent() ResourceUnit
	// Start starts the autoscaler go routine that scales the ResourceUnit according to Estimator
	Start()
	// Stop stops the autoscaler if started or do nothing if not yet started
	Stop()
}

AutoScaler collects data and estimate usage

type Estimator

type Estimator interface {
	CollectUsage(data interface{}) error
	Estimate() (Usages, error)
	Reset()
}

Estimator collects data and estimate usage

type MilliUsage

type MilliUsage uint64

MilliUsage is the custom defined usage of ResourceUnit times 1000

func (MilliUsage) Value

func (u MilliUsage) Value() float64

Value helper method for type conversion

type Recommender

type Recommender interface {
	Recommend(currentResource ResourceUnit, currentUsages Usages) ResourceUnit
}

Recommender a recommendation generator for ResourceUnit

func NewLinearRecommender

func NewLinearRecommender(lower, upper ResourceUnit, targetUsages Usages) Recommender

NewLinearRecommender create a linear Recommender

type ResourceUnit

type ResourceUnit uint

ResourceUnit is the unit of scalable resources

func (ResourceUnit) Value

func (r ResourceUnit) Value() float64

Value helper method for type conversion

type UsageType

type UsageType string

UsageType type of usage

const (
	// PollerUtilizationRate is a scale from 0 to 1 to indicate poller usages
	PollerUtilizationRate UsageType = "pollerUtilizationRate"
)

type Usages

type Usages map[UsageType]MilliUsage

Usages are different measurements used by a Recommender to provide a recommended ResourceUnit

Jump to

Keyboard shortcuts

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