metricnaming

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

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
}

func (*GeneralMetricNamer) AddSelectorRequirement

func (gmn *GeneralMetricNamer) AddSelectorRequirement(requirement labels.Requirement)

func (*GeneralMetricNamer) BuildUniqueKey

func (gmn *GeneralMetricNamer) BuildUniqueKey() string

func (*GeneralMetricNamer) QueryBuilder

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

func (*GeneralMetricNamer) Validate

func (gmn *GeneralMetricNamer) Validate() error

type MetricNamer

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

	Validate() error

	AddSelectorRequirement(requirement labels.Requirement)
}

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

func ContainerMetricNamer

func ContainerMetricNamer(clusterid, kind, namespace, workloadName, containername, metricName string, containerLabelSelector labels.Selector) MetricNamer

func ResourceToContainerMetricNamer

func ResourceToContainerMetricNamer(clusterid, namespace, workloadName, containername string, resourceName corev1.ResourceName) MetricNamer

func ResourceToWorkloadMetricNamer

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

func WorkloadMetricNamer

func WorkloadMetricNamer(clusterid string, target *corev1.ObjectReference, metricName string, workloadLabelSelector labels.Selector) MetricNamer

Jump to

Keyboard shortcuts

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