controller

package
v0.0.0-...-730abb5 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LabelGroupReconciler

type LabelGroupReconciler struct {
	client.Client
	Scheme                     *runtime.Scheme
	KeplerPrometheusUrl        string
	KeplerMetricName           string
	SusQLPrometheusDatabaseUrl string
	SusQLPrometheusMetricsUrl  string
	SamplingRate               time.Duration // Sampling rate for all label groups
	Logger                     logr.Logger
}

LabelGroupReconciler reconciles a LabelGroup object

func (*LabelGroupReconciler) GetMetricValuesForPodNames

func (r *LabelGroupReconciler) GetMetricValuesForPodNames(metricName string, podNames []string, namespaceNames []string) (map[string]float64, error)

func (*LabelGroupReconciler) GetMostRecentValue

func (r *LabelGroupReconciler) GetMostRecentValue(susqlPrometheusQuery string) (float64, error)

Functions to get data from the cluster

func (*LabelGroupReconciler) GetPodNamesMatchingLabels

func (r *LabelGroupReconciler) GetPodNamesMatchingLabels(ctx context.Context, labelGroup *susqlv1.LabelGroup) ([]string, []string, error)

Functions to get data from the cluster

func (*LabelGroupReconciler) InitializeMetricsExporter

func (r *LabelGroupReconciler) InitializeMetricsExporter()

func (*LabelGroupReconciler) Reconcile

func (r *LabelGroupReconciler) 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. TODO(user): Modify the Reconcile function to compare the state specified by the LabelGroup object against the actual cluster state, and then perform operations to make the cluster state reflect the state specified by the user.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.15.0/pkg/reconcile

func (*LabelGroupReconciler) SetAggregatedEnergyForLabels

func (r *LabelGroupReconciler) SetAggregatedEnergyForLabels(totalEnergy float64, prometheusLabels map[string]string) error

func (*LabelGroupReconciler) SetupWithManager

func (r *LabelGroupReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type SusqlMetrics

type SusqlMetrics struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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