analysis

package
v0.0.0-...-9d026b8 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

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

func (a *AnalysisReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

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 IProvidersPool interface {
	StartProviders(ctx context.Context, numJobs int)
	DispatchToProviders(ctx context.Context, id int)
	GetResult(ctx context.Context) (*metricsapi.ProviderResult, error)
	StopProviders()
}

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 (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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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