metricnaming

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2022 License: Apache-2.0 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 {
	// Used for datasource provider, data source provider call QueryBuilder
	QueryBuilder() querybuilder.QueryBuilder
	// Used for predictor now
	BuildUniqueKey() string

	Validate() error

	// 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 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