Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBaseScalingContext ¶
func NewBaseScalingContext() *baseScalingContext
NewBaseScalingContext creates a new instance of BaseScalingContext with default values.
Types ¶
type MetricTarget ¶
type MetricTarget struct {
// The value of scaling metric per pod that we target to maintain.
TargetValue float64
// The total value of scaling metric that a pod can maintain.
TotalValue float64
// The metric used for scaling, i.e. CPU, Memory, QPS.
ScalingMetric string
MetricType autoscalingv1alpha1.MetricSourceType
}
type ScalingContext ¶
type ScalingContext interface {
GetTargetValueForMetric(metricName string) (float64, bool)
GetUpFluctuationTolerance() float64
GetDownFluctuationTolerance() float64
GetMaxScaleUpRate() float64
GetMaxScaleDownRate() float64
GetCurrentUsePerPod() float64
SetCurrentUsePerPod(float64)
UpdateByPaTypes(pa *autoscalingv1alpha1.PodAutoscaler) error
GetMinReplicas() int32
GetMaxReplicas() int32
GetStableValue() float64
SetStableValue(float64)
GetPanicValue() float64
SetPanicValue(float64)
SetActivationScale(value int32)
GetActivationScale() int32
GetPanicThreshold() float64
GetInPanicMode() bool
SetInPanicMode(bool)
GetMaxPanicPods() int32
SetMaxPanicPods(int32)
GetScaleUpCooldownWindow() time.Duration
GetScaleDownCooldownWindow() time.Duration
GetScaleToZero() bool
}
ScalingContext defines the generalized context that holds all necessary data for scaling calculations. This is the single source of truth for all scaling configuration, extracted per-PodAutoscaler.
Click to show internal directories.
Click to hide internal directories.