util

package
v0.0.0-...-0701c2b Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOUR   = "h"
	SECOND = "s"
	MINUTE = "m"
	MONTH  = "M"
	DAY    = "D"
)
View Source
const ALWAYS_RESIZE_ALGORITHM = "always-resize"
View Source
const BEST_RESOURCE_PAIR_ALGORITHM = "best-resource-pair"
View Source
const CONFIG_FILE = "config.yml"
View Source
const COST = "cost"

metrics

View Source
const DEFAULT_LOGFILE = "Logs.log"
View Source
const DEFAULT_POD_BOOT_TIME = 20
View Source
const DEFAULT_VM_BOOT_TIME = 20
View Source
const DEFAULT_VM_SHUTDOWN_TIME = 35
View Source
const DERIVATION_TIME = "derivation-time"
View Source
const ENDPOINT_ALL_VM_TIMES = "/getPerVMTypeAllBootShutDownData"
View Source
const ENDPOINT_CURRENT_STATE = "/api/current"
View Source
const ENDPOINT_FORECAST = "/predict"
View Source
const ENDPOINT_INVALIDATE_STATES = "/api/invalidate/{timestamp}"
View Source
const ENDPOINT_RECIVE_NOTIFICATIONS = "/api/forecast"
View Source
const ENDPOINT_SERVICE_PROFILES = "/getRegressionTRNsMongoDBAll/{apptype}/{appname}/{mainservicename}"
View Source
const ENDPOINT_SERVICE_PROFILE_BY_MSC = "/getPredictedRegressionReplicas/{apptype}/{appname}/{mainservicename}/{msc}/{numcoresutil}/{numcoreslimit}/{nummemlimit}"
View Source
const ENDPOINT_SERVICE_PROFILE_BY_REPLICAS = "/getPredictedRegressionTRN/{apptype}/{appname}/{mainservicename}/{replicas}/{numcoresutil}/{numcoreslimit}/{nummemlimit}"
View Source
const ENDPOINT_STATES = "/api/states"
View Source
const ENDPOINT_SUBSCRIBE_NOTIFICATIONS = "/subscribe"
View Source
const ENDPOINT_VMS_PROFILES = "/api/vms"
View Source
const ENDPOINT_VM_TIMES = "/getPerVMTypeOneBootShutDownData"
View Source
const NAIVE_ALGORITHM = "naive"

Algorithms names

View Source
const ONLY_DELTA_ALGORITHM = "only-delta-load"
View Source
const PERCENTAGE_REQUIRED_k8S_INSTALLATION_CPU = 0.06
View Source
const PERCENTAGE_REQUIRED_k8S_INSTALLATION_MEM = 0.25
View Source
const RESIZE_WHEN_BENEFICIAL = "resize-when-beneficial"
View Source
const SCALE_METHOD_HORIZONTAL = "horizontal"

Algorithms options

View Source
const SCALE_METHOD_HYBRID = "hybrid"
View Source
const SCALE_METHOD_VERTICAL = "vertical"
View Source
const TIME_ADD_NODE_TO_K8S = 120
View Source
const TIME_CONTAINER_START = 10
View Source
const TRANSITION_TIME = "transition-time"
View Source
const UTC_TIME_LAYOUT = "2006-01-02T15:04:00Z"

Variables

This section is empty.

Functions

func MillisecondsToSeconds

func MillisecondsToSeconds(m float64) float64
 Utility function to convert from milliseconds to seconds
	in:
		@m  miliseconds
	out:
		@float	seconds

func ParseIntervalToSeconds

func ParseIntervalToSeconds(interval string) int64

func ParseURL

func ParseURL(endpoint string, parameters map[string]string) string
 Parses the parameters given in the endpoint template and replaces them for real values
	in:
		@endpoint string to parse
		@parameters map with key-values
	out:
		@string	Endpoint with new values

func RoundN

func RoundN(value float64, decimals float64) float64
 Round a float to n decimals
	in:
		@value  value to be rounded
		@decimals  number of decimals after coma
	out:
		@float	new value rounded

Types

type Component

type Component struct {
	Endpoint string `yaml:"endpoint"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
	ApiKey   string `yaml:"api-key"`
}

Struct that models the external components to which SPDT should be connected

type FlagVars

type FlagVars struct {
	LogFile bool
}

func ParseFlags

func ParseFlags() FlagVars

type ForecastComponent

type ForecastComponent struct {
	Endpoint    string `yaml:"endpoint"`
	Granularity string `yaml:"granularity"`
}

Struct that models the external components to which SPDT should be connected

type PolicySettings

type PolicySettings struct {
	ScalingMethod   string `yaml:"vm-scaling-method"`
	PreferredMetric string `yaml:"preferred-metric"`
}

type PricingModel

type PricingModel struct {
	Budget      float64 `yaml:"monthly-budget"`
	BillingUnit string  `yaml:"billing-unit"`
}

type ScalingHorizon

type ScalingHorizon struct {
	StartTime time.Time `yaml:"start-time"`
	EndTime   time.Time `yaml:"end-time"`
}

The future timespan for which the autoscaling policy is derived

type SystemConfiguration

type SystemConfiguration struct {
	Host                         string            `yaml:"host"`
	CSP                          string            `yaml:"CSP"`
	Region                       string            `yaml:"region"`
	AppName                      string            `yaml:"app-name"`
	MainServiceName              string            `yaml:"main-service-name"`
	AppType                      string            `yaml:"app-type"`
	PricingModel                 PricingModel      `yaml:"pricing-model"`
	ForecastComponent            ForecastComponent `yaml:"forecasting-component"`
	PerformanceProfilesComponent Component         `yaml:"performance-profiles-component"`
	SchedulerComponent           Component         `yaml:"scheduler-component"`
	ScalingHorizon               ScalingHorizon    `yaml:"scaling-horizon"`
	PreferredAlgorithm           string            `yaml:"preferred-algorithm"`
	PolicySettings               PolicySettings    `yaml:"policy-settings"`
	PullingInterval              int               `yaml:"pulling-interval"`
	StorageInterval              string            `yaml:"storage-interval"`
}

Struct that models the system configuration to derive the scaling policies

func ReadConfigFile

func ReadConfigFile(configFile string) (SystemConfiguration, error)

Method that parses the configuration file into a struct type

Jump to

Keyboard shortcuts

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