Documentation
¶
Index ¶
- Constants
- func GetRecommendation(ctx context.Context, workload *workload.State, recommenders []Interface) (*tfv1.Resources, error)
- func QuantityFromAmount(amount ResourceAmount, format resource.Format) resource.Quantity
- type CronRecommender
- type EstimatedResources
- type Interface
- type PercentileConfig
- type PercentileRecommender
- type RecResult
- type RecommendationProcessor
- type ResourceAmount
- type ResourcesEstimator
- type TflopsEstimator
- type VramEstimator
Constants ¶
View Source
const ( // MaxResourceAmount is the maximum allowed value of resource amount. MaxResourceAmount = ResourceAmount(1e14) )
Variables ¶
This section is empty.
Functions ¶
func GetRecommendation ¶
func QuantityFromAmount ¶
func QuantityFromAmount(amount ResourceAmount, format resource.Format) resource.Quantity
Types ¶
type CronRecommender ¶
type CronRecommender struct {
// contains filtered or unexported fields
}
func NewCronRecommender ¶
func NewCronRecommender(recommendationProcessor RecommendationProcessor) *CronRecommender
func (*CronRecommender) Name ¶
func (c *CronRecommender) Name() string
type EstimatedResources ¶
type Interface ¶
type Interface interface { Name() string Recommend(ctx context.Context, workload *workload.State) (*RecResult, error) }
Interface defines the contract for resource recommendation strategies used by the autoscaler.
type PercentileConfig ¶
type PercentileRecommender ¶
type PercentileRecommender struct { ResourcesEstimator // contains filtered or unexported fields }
func NewPercentileRecommender ¶
func NewPercentileRecommender(recommendationProcessor RecommendationProcessor) *PercentileRecommender
func (*PercentileRecommender) Name ¶
func (p *PercentileRecommender) Name() string
type RecommendationProcessor ¶
type RecommendationProcessor interface {
Apply(ctx context.Context, workload *workload.State, recommendation *tfv1.Resources) (tfv1.Resources, string, error)
}
func NewRecommendationProcessor ¶
func NewRecommendationProcessor(workloadHandler workload.Handler) RecommendationProcessor
type ResourceAmount ¶
type ResourceAmount int64
func ResourceAmountMax ¶
func ResourceAmountMax(amount1, amount2 ResourceAmount) ResourceAmount
ResourceAmountMax returns the larger of two resource amounts.
type ResourcesEstimator ¶
type ResourcesEstimator interface {
GetResourcesEstimation(*workload.State) *EstimatedResources
}
type TflopsEstimator ¶
type TflopsEstimator interface {
GetTflopsEstimation(w *metrics.WorkerUsageAggregator) ResourceAmount
}
func NewPercentileTflopsEstimator ¶
func NewPercentileTflopsEstimator(percentile float64) TflopsEstimator
NewPercentileTflopsEstimator returns a new percentileTflopsEstimator that uses provided percentile.
func WithTflopsConfidenceMultiplier ¶
func WithTflopsConfidenceMultiplier(multiplier, exponent float64, baseEstimator TflopsEstimator, confidenceInterval time.Duration) TflopsEstimator
WithTflopsConfidenceMultiplier returns a TflopsEstimator that scales the
func WithTflopsMargin ¶
func WithTflopsMargin(marginFraction float64, baseEstimator TflopsEstimator) TflopsEstimator
WithTflopsMargin returns a tflopsEstimator that adds a margin to the base estimator.
type VramEstimator ¶
type VramEstimator interface {
GetVramEstimation(w *metrics.WorkerUsageAggregator) ResourceAmount
}
func NewPercentileVramEstimator ¶
func NewPercentileVramEstimator(percentile float64) VramEstimator
NewPercentileVramEstimator returns a new percentileVramEstimator that uses provided percentile.
func WithVramConfidenceMultiplier ¶
func WithVramConfidenceMultiplier(multiplier, exponent float64, baseEstimator VramEstimator, confidenceInterval time.Duration) VramEstimator
WithVramConfidenceMultiplier returns a VramEstimator that scales the
func WithVramMargin ¶
func WithVramMargin(marginFraction float64, baseEstimator VramEstimator) VramEstimator
WithvramMargin returns a vramEstimator that adds a margin to the base estimator.
Click to show internal directories.
Click to hide internal directories.