Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AnalysisReconciler ¶
type AnalysisReconciler struct { client.Client Scheme *runtime.Scheme Log logr.Logger MaxWorkers int //maybe 2 or 4 as def NewWorkersPoolFactory common.IAnalysisEvaluator // contains filtered or unexported fields }
AnalysisReconciler reconciles an Analysis object
func (*AnalysisReconciler) Reconcile ¶
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. For more details, check Reconcile and its AnalysisResult here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.13.0/pkg/reconcile
func (*AnalysisReconciler) SetAnalysisResultsChannel ¶
func (a *AnalysisReconciler) SetAnalysisResultsChannel(c chan evalType.AnalysisCompletion)
func (*AnalysisReconciler) SetupWithManager ¶
func (a *AnalysisReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type IAnalysisPool ¶
type IAnalysisPool interface {
DispatchAndCollect(ctx context.Context) (map[string]metricsapi.ProviderResult, error)
}
func NewWorkersPool ¶
func NewWorkersPool(ctx context.Context, analysis *metricsapi.Analysis, objectives []metricsapi.Objective, numWorkers int, c client.Client, log logr.Logger, namespace string) (context.Context, IAnalysisPool)
type IObjectivesEvaluator ¶
type IObjectivesEvaluator interface {
Evaluate(ctx context.Context, metricsProvider *metricsapi.KeptnMetricsProvider, obj chan metricstypes.ProviderRequest)
}
type IProvidersPool ¶
type ITaskAssigner ¶
type ITaskAssigner interface {
AssignTasks(tasks []metricsapi.Objective, numWorkers int) [][]metricsapi.Objective
}
type NewWorkersPoolFactory ¶
type NewWorkersPoolFactory func(ctx context.Context, analysis *metricsapi.Analysis, objectives []metricsapi.Objective, numWorkers int, c client.Client, log logr.Logger, namespace string) (context.Context, IAnalysisPool)
type ObjectivesEvaluator ¶
type ObjectivesEvaluator struct { *metricsapi.Analysis providers.ProviderFactory client.Client // contains filtered or unexported fields }
func (ObjectivesEvaluator) Evaluate ¶
func (oe ObjectivesEvaluator) Evaluate(ctx context.Context, metricsProvider *metricsapi.KeptnMetricsProvider, obj chan metricstypes.ProviderRequest)
type ProvidersPool ¶
type ProvidersPool struct { IObjectivesEvaluator client.Client Namespace string Objectives map[int][]metricsapi.Objective *metricsapi.Analysis // contains filtered or unexported fields }
func (ProvidersPool) DispatchToProviders ¶
func (ps ProvidersPool) DispatchToProviders(ctx context.Context, id int)
func (ProvidersPool) GetResult ¶
func (ps ProvidersPool) GetResult(ctx context.Context) (*metricsapi.ProviderResult, error)
func (ProvidersPool) StartProviders ¶
func (ps ProvidersPool) StartProviders(ctx context.Context, numJobs int)
func (ProvidersPool) StopProviders ¶
func (ps ProvidersPool) StopProviders()
type TaskAssigner ¶
type TaskAssigner struct {
// contains filtered or unexported fields
}
type WorkersPool ¶
type WorkersPool struct { IProvidersPool // contains filtered or unexported fields }
func (WorkersPool) CollectAnalysisResults ¶
func (aw WorkersPool) CollectAnalysisResults(ctx context.Context) (map[string]metricsapi.ProviderResult, error)
func (WorkersPool) DispatchAndCollect ¶
func (aw WorkersPool) DispatchAndCollect(ctx context.Context) (map[string]metricsapi.ProviderResult, error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.