Documentation ¶
Index ¶
- Variables
- func NewProvider(ctx context.Context, client dynamic.Interface, namespace string) provider.CustomMetricsProvider
- type CustomMetricValue
- type CustomMetricsCache
- func (cm *CustomMetricsCache) Delete(metricName types.NamespacedName)
- func (cm *CustomMetricsCache) Get(metricName types.NamespacedName) (*CustomMetricValue, error)
- func (cm *CustomMetricsCache) GetValuesByLabel(selector labels.Selector) []CustomMetricValue
- func (cm *CustomMetricsCache) List() []provider.CustomMetricInfo
- func (cm *CustomMetricsCache) ListByLabelSelector(selector labels.Selector) []provider.CustomMetricInfo
- func (cm *CustomMetricsCache) Update(metricName string, metricValue CustomMetricValue)
Constants ¶
This section is empty.
Variables ¶
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 ¶
func (cm *CustomMetricsCache) Get(metricName types.NamespacedName) (*CustomMetricValue, error)
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 ¶
func (cm *CustomMetricsCache) List() []provider.CustomMetricInfo
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.