provider

package
v0.0.0-...-8987cd1 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

View Source
var ErrMetricNotFound = errors.New("no metric value found")

Functions

func NewProvider

func NewProvider(ctx context.Context, client dynamic.Interface, namespace string) provider.CustomMetricsProvider

NewProvider creates and starts a new keptnMetricsProvider. The provider will run until the given context is cancelled. the client passed to this function will be used to set up a dynamic informer that listens for KeptnMetric CRDs and provides metric values that reflect their states.

Types

type CustomMetricValue

type CustomMetricValue struct {
	Value  custom_metrics.MetricValue
	Labels map[string]string
}

type CustomMetricsCache

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

func (*CustomMetricsCache) Delete

func (cm *CustomMetricsCache) Delete(metricName types.NamespacedName)

Delete will delete the value for the given metricName

func (*CustomMetricsCache) Get

Get returns the metric value for the given metric name

func (*CustomMetricsCache) GetValuesByLabel

func (cm *CustomMetricsCache) GetValuesByLabel(selector labels.Selector) []CustomMetricValue

GetValuesByLabel returns a slice of CustomMetricValue objects containing the values of all available metrics that match with the given label

func (*CustomMetricsCache) List

List returns a slice of provider.CustomMetricInfo objects containing all the available metrics that are currently present in the cache

func (*CustomMetricsCache) ListByLabelSelector

func (cm *CustomMetricsCache) ListByLabelSelector(selector labels.Selector) []provider.CustomMetricInfo

ListByLabelSelector returns a slice of provider.CustomMetricInfo objects containing all the available metrics that are currently present in the cache and match with the provided labels

func (*CustomMetricsCache) Update

func (cm *CustomMetricsCache) Update(metricName string, metricValue CustomMetricValue)

Update adds a new metricValue for the given metricName to the cache. If an item has already been present for the provided metricName, the previous value will be replaced.

Jump to

Keyboard shortcuts

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