config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config provides configuration options for the Predictive Horizontal Pod Autoscaler

Index

Constants

View Source
const (
	// DecisionMaximum means use the highest predicted value from the models
	DecisionMaximum = "maximum"
	// DecisionMinimum means use the lowest predicted value from the models
	DecisionMinimum = "minimum"
	// DecisionMean means use the mean average of predicted values
	DecisionMean = "mean"
	// DecisionMedian means use the median average of predicted values
	DecisionMedian = "median"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Models                  []*Model                   `json:"models"`
	Metrics                 []autoscalingv2.MetricSpec `json:"metrics"`
	DecisionType            string                     `json:"decisionType"`
	DBPath                  string                     `json:"dbPath"`
	MigrationPath           string                     `json:"migrationPath"`
	Tolerance               float64                    `json:"tolerance"`
	CPUInitializationPeriod int                        `json:"cpuInitializationPeriod"`
	InitialReadinessDelay   int                        `json:"initialReadinessDelay"`
}

Config holds the configuration of the Predictive element of the PHPA

func LoadConfig

func LoadConfig(configEnv io.Reader) (*Config, error)

LoadConfig takes in the predictive config as a byte array and uses it to build the config, overriding default values

type HoltWinters added in v0.2.0

type HoltWinters struct {
	Alpha         float64 `json:"alpha"`
	Beta          float64 `json:"beta"`
	Gamma         float64 `json:"gamma"`
	SeasonLength  int     `json:"seasonLength"`
	StoredSeasons int     `json:"storedSeasons"`
	Method        string  `json:"method"`
}

HoltWinters represents a holt-winters exponential smoothing prediction model configuration

type Linear

type Linear struct {
	StoredValues int `json:"storedValues"`
	LookAhead    int `json:"lookAhead"`
}

Linear represents a linear regression prediction model configuration

type Model

type Model struct {
	Type        string       `json:"type"`
	Name        string       `json:"name"`
	PerInterval int          `json:"perInterval"`
	Linear      *Linear      `json:"linear"`
	HoltWinters *HoltWinters `json:"holtWinters"`
}

Model represents a prediction model to use, e.g. a linear regression

Jump to

Keyboard shortcuts

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