metricnaming

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: Apache-2.0, BSD-2-Clause Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQueryBuilder

func NewQueryBuilder(metric *metricquery.Metric) querybuilder.QueryBuilder

Types

type GeneralMetricNamer

type GeneralMetricNamer struct {
	Metric     *metricquery.Metric
	CallerName string
}

func (*GeneralMetricNamer) BuildUniqueKey

func (gmn *GeneralMetricNamer) BuildUniqueKey() string

func (*GeneralMetricNamer) Caller added in v0.5.0

func (gmn *GeneralMetricNamer) Caller() string

func (*GeneralMetricNamer) QueryBuilder

func (gmn *GeneralMetricNamer) QueryBuilder() querybuilder.QueryBuilder

func (*GeneralMetricNamer) Validate

func (gmn *GeneralMetricNamer) Validate() error

type MetricNamer

type MetricNamer interface {
	// QueryBuilder used for datasource provider, data source provider call QueryBuilder
	QueryBuilder() querybuilder.QueryBuilder
	// BuildUniqueKey used for predictor now
	BuildUniqueKey() string

	Validate() error

	// Caller means the caller of this MetricNamer, different caller maybe use the same metric
	Caller() string
}

MetricNamer is an interface. it is the bridge between predictor and different data sources and other component such as caller.

func ResourceToContainerMetricNamer added in v0.7.0

func ResourceToContainerMetricNamer(namespace, apiVersion, workloadKind, workloadName, containerName string, resourceName corev1.ResourceName, caller string) MetricNamer

func ResourceToGeneralMetricNamer added in v0.11.0

func ResourceToGeneralMetricNamer(queryExpr string, resourceName corev1.ResourceName, nodeLabelSelector labels.Selector, caller string) MetricNamer

func ResourceToWorkloadMetricNamer added in v0.7.0

func ResourceToWorkloadMetricNamer(target *corev1.ObjectReference, resourceName *corev1.ResourceName, workloadLabelSelector labels.Selector, caller string) MetricNamer

Jump to

Keyboard shortcuts

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