Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
type Calculator interface { GetUsageRatioReplicaCount(currentReplicas int32, usageRatio float64, readyPodCount int64) int32 GetPlainMetricReplicaCount(metrics podmetrics.MetricsInfo, currentReplicas int32, targetUtilization int64, readyPodCount int64, missingPods, ignoredPods sets.String) int32 }
Calculator is used to calculate replica counts
type ReplicaCalculator ¶
type ReplicaCalculator struct {
Tolerance float64
}
ReplicaCalculator uses a tolerance provided to calculate replica counts for scaling up/down/remaining the same
func (*ReplicaCalculator) GetPlainMetricReplicaCount ¶
func (r *ReplicaCalculator) GetPlainMetricReplicaCount(metrics podmetrics.MetricsInfo, currentReplicas int32, targetUtilization int64, readyPodCount int64, missingPods, ignoredPods sets.String) int32
GetPlainMetricReplicaCount calculates the replica count based on the metrics of each pod and a target utilization, providing a different replica count if the calculated usage ratio is beyond the tolerance
func (*ReplicaCalculator) GetUsageRatioReplicaCount ¶
func (r *ReplicaCalculator) GetUsageRatioReplicaCount(currentReplicas int32, usageRatio float64, readyPodCount int64) int32
GetUsageRatioReplicaCount calculates the replica count based on the number of replicas, number of ready pods and the usage ratio of the metric - providing a different value if beyond the tolerance
Click to show internal directories.
Click to hide internal directories.