Documentation ¶
Index ¶
- func BilledTime(timeStart time.Time, timeEnd time.Time, unit string) float64
- func ComputePolicyCost(policy types.Policy, billingUnit string, ...) float64
- func ComputePolicyMetrics(scalingActions *[]types.ScalingAction, forecast []types.ForecastedValue, ...) (types.PolicyMetrics, map[string]bool)
- func DeltaVMSet(current types.VMScale, candidate types.VMScale) (types.VMScale, types.VMScale)
- func Drucken(n *Node, level int)
- func MapKeysToString(keys map[string]bool) string
- func Policies(sortedVMProfiles []types.VmProfile, sysConfiguration util.SystemConfiguration, ...) ([]types.Policy, error)
- func SelectPolicy(policies *[]types.Policy, sysConfig util.SystemConfiguration, ...) (types.Policy, error)
- func VMListToMap(listVMProfiles []types.VmProfile) map[string]types.VmProfile
- type AlwaysResizePolicy
- type BestResourcePairPolicy
- type DeltaLoadPolicy
- type MSCProfile
- type NaivePolicy
- type Node
- type PolicyDerivation
- type ResizeWhenBeneficialPolicy
- type Tree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BilledTime ¶
Calculate detlta time for a time window
func ComputePolicyCost ¶
func ComputePolicyCost(policy types.Policy, billingUnit string, mapVMProfiles map[string]types.VmProfile) float64
Compute the total cost for a given policy It takes into account the billing unit according to the pricing model
func ComputePolicyMetrics ¶
func ComputePolicyMetrics(scalingActions *[]types.ScalingAction, forecast []types.ForecastedValue, sysConfiguration util.SystemConfiguration, mapVMProfiles map[string]types.VmProfile) (types.PolicyMetrics, map[string]bool)
Compute the metrics related to the policy and its scaling actions
func DeltaVMSet ¶
compare the changes (vms added, vms removed) from one VM set to a candidate VM set in: @current - Map with current VM cluster @candidate - Map with candidate VM cluster out: @VMScale - Map with VM cluster of the VMs that were added into the candidate VM set @VMScale - Map with VM cluster of the VMs that were removed from the candidate VM set
func MapKeysToString ¶
func Policies ¶
func Policies(sortedVMProfiles []types.VmProfile, sysConfiguration util.SystemConfiguration, forecast types.Forecast) ([]types.Policy, error)
Derive scaling policies in: @poiList []types.PoI @values []float64 @times [] time.Time @sortedVMProfiles []VmProfile @sysConfiguration SystemConfiguration out: @[]types.Policy
func SelectPolicy ¶
func SelectPolicy(policies *[]types.Policy, sysConfig util.SystemConfiguration, vmProfiles []types.VmProfile, forecast types.Forecast) (types.Policy, error)
Evaluates and select the most suitable policy for the given system configurations and forecast
in: @policies *[]types.Policy - List of derived policies @sysConfig config.SystemConfiguration - Configuration specified by the user in the config file @vmProfiles []types.VmProfile - List of virtual machines profiles @forecast types.Forecast - Forecast of the expected load out: @types.Policy - Selected policy @error - Error in case of any
Types ¶
type AlwaysResizePolicy ¶
type AlwaysResizePolicy struct {
// contains filtered or unexported fields
}
func (AlwaysResizePolicy) CreatePolicies ¶
func (p AlwaysResizePolicy) CreatePolicies(processedForecast types.ProcessedForecast) []types.Policy
Derive a list of policies using the best homogeneous cluster, change of type is possible in: @processedForecast @serviceProfile out: [] Policy. List of type Policy
func (AlwaysResizePolicy) FindSuitableVMs ¶
func (p AlwaysResizePolicy) FindSuitableVMs(numberReplicas int, limits types.Limit) (types.VMScale, error)
Calculate VM set able to host the required number of replicas
in: @numberReplicas = Amount of replicas that should be hosted @limits = Resources (CPU, Memory) constraints to configure the containers. out: @VMScale with the suggested number of VMs for that type
type BestResourcePairPolicy ¶
type BestResourcePairPolicy struct {
// contains filtered or unexported fields
}
After each change in the workload it calculates the number of VMs of a predefined size needed Repeat the process for all the vm types available
func (BestResourcePairPolicy) CreatePolicies ¶
func (p BestResourcePairPolicy) CreatePolicies(processedForecast types.ProcessedForecast) []types.Policy
Derive a list of policies using the Best Instance Approach approach in: @processedForecast @serviceProfile out: [] Policy. List of type Policy
func (BestResourcePairPolicy) FindSuitableVMs ¶
func (p BestResourcePairPolicy) FindSuitableVMs(numberReplicas int, resourcesLimit types.Limit, vmType string) (types.VMScale, error)
Calculate VM set able to host the required number of replicas
in: @numberReplicas = Amount of replicas that should be hosted @resourcesLimit = Resources (CPU, Memory) constraints to configure the containers. out: @VMScale with the suggested number of VMs for that type
type DeltaLoadPolicy ¶
type DeltaLoadPolicy struct {
// contains filtered or unexported fields
}
Constructs different VM clusters to add resources every time the workload increases in a factor of deltaLoad.
func (DeltaLoadPolicy) CreatePolicies ¶
func (p DeltaLoadPolicy) CreatePolicies(processedForecast types.ProcessedForecast) []types.Policy
Derive a list of policies using this approach in: @processedForecast out: [] Policy. List of type Policy
func (DeltaLoadPolicy) FindSuitableVMs ¶
Calculate VM set able to host the required number of replicas
in: @numberReplicas = Amount of replicas that should be hosted @limits = Resources (CPU, Memory) constraints to configure the containers. out: @VMScale with the suggested number of VMs for that type
type MSCProfile ¶
type NaivePolicy ¶
type NaivePolicy struct {
// contains filtered or unexported fields
}
It assumes that the current VM set where the microservice is deployed is a homogeneous set Based on the unique VM type and its capacity to host a number of replicas it increases or decreases the number of VMs
func (NaivePolicy) CreatePolicies ¶
func (p NaivePolicy) CreatePolicies(processedForecast types.ProcessedForecast) []types.Policy
Derive a list of policies using the Naive approach in: @processedForecast @serviceProfile out: [] Policy. List of type Policy
func (NaivePolicy) FindSuitableVMs ¶
Calculate VM set able to host the required number of replicas
in: @numberPods = Amount of pods that should be hosted @limits = Resources (CPU, Memory) constraints to configure the containers. out: @VMScale with the suggested number of VMs for that type
type Node ¶
type Node struct { NReplicas int // contains filtered or unexported fields }
Node that represents a candidate option to scale
type PolicyDerivation ¶
type PolicyDerivation interface { CreatePolicies(processedForecast types.ProcessedForecast) []types.Policy FindSuitableVMs(numberReplicas int, limits types.Limit) types.VMScale }
Interface for strategies of how to scale
type ResizeWhenBeneficialPolicy ¶
type ResizeWhenBeneficialPolicy struct {
// contains filtered or unexported fields
}
After each change in the workload it calculates the number of VMs of a predefined size needed Repeat the process for all the vm types available
func (ResizeWhenBeneficialPolicy) CreatePolicies ¶
func (p ResizeWhenBeneficialPolicy) CreatePolicies(processedForecast types.ProcessedForecast) []types.Policy
Derive a list of policies Add vmSet to handle delta load and compare the reconfiguration cost against the vmSet optimized for a total load. in: @processedForecast @serviceProfile out: [] Policy. List of type Policy
func (ResizeWhenBeneficialPolicy) FindSuitableVMs ¶
func (p ResizeWhenBeneficialPolicy) FindSuitableVMs(numberReplicas int, resourceLimits types.Limit) types.VMScale
Calculate VM set able to host the required number of replicas
in: @numberReplicas = Amount of replicas that should be hosted @resourceLimits = Resources (CPU, Memory) constraints to configure the containers. out: @VMScale with the suggested number of VMs