base

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0, BSD-2-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultCreationCoolDown = time.Minute * 3

Variables

This section is empty.

Functions

func IsIdentitySupported

func IsIdentitySupported(identity framework.ObjectIdentity, selectors []analysisapi.ResourceSelector) bool

IsIdentitySupported check whether object identity fit resource selector.

Types

type BaseRecommender

type BaseRecommender struct {
	apis.Recommender
	CreationCoolDown time.Duration
}

func NewBaseRecommender

func NewBaseRecommender(recommender apis.Recommender) *BaseRecommender

NewBaseRecommender create a new base recommender.

func (*BaseRecommender) CheckDataProviders

func (br *BaseRecommender) CheckDataProviders(ctx *framework.RecommendationContext) error

CheckDataProviders in PrePrepare phase, will create data source provider via your recommendation config.

func (*BaseRecommender) CollectData

func (br *BaseRecommender) CollectData(ctx *framework.RecommendationContext) error

func (*BaseRecommender) Filter

Filter out k8s resources that are not supported by the recommender.

func (*BaseRecommender) GetPercentile added in v0.11.0

func (br *BaseRecommender) GetPercentile(percentile float64, ts []*common.TimeSeries) (float64, error)

func (*BaseRecommender) Name

func (br *BaseRecommender) Name() string

func (*BaseRecommender) Observe

Observe enhance the observability.

func (*BaseRecommender) Policy

Policy add some logic for result of recommend phase.

func (*BaseRecommender) PostProcessing

func (br *BaseRecommender) PostProcessing(ctx *framework.RecommendationContext) error

func (*BaseRecommender) PreRecommend

func (br *BaseRecommender) PreRecommend(ctx *framework.RecommendationContext) error

func (*BaseRecommender) Recommend

Jump to

Keyboard shortcuts

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