provider

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackExternalMetricValueList

func PackExternalMetricValueList(internal *data.InternalMetric) []external_metrics.ExternalMetricValue

func PackMetricValue

func PackMetricValue(internal *data.InternalMetric, value *data.InternalValue) *custom_metrics.MetricValue

func PackMetricValueList

func PackMetricValueList(internal *data.InternalMetric) []custom_metrics.MetricValue

Types

type DummyMetricQuery

type DummyMetricQuery struct{}

func (DummyMetricQuery) ListAllExternalMetrics

func (d DummyMetricQuery) ListAllExternalMetrics() []provider.ExternalMetricInfo

func (DummyMetricQuery) ListAllMetrics

func (d DummyMetricQuery) ListAllMetrics() []provider.CustomMetricInfo

type MetricProvider

type MetricProvider interface {
	provider.MetricsProvider
}

MetricProvider is a standard interface to query metric data; to simplify the implementation, MetricProvider use the standard kubernetes interface for custom-metrics and external-metrics; and provider.MetricsProvider may have different explanations for their parameters, we make the following appoints

- GetMetricByName --- if metric name is nominated, ignore the selector; --- otherwise, return all the metrics matched with the metric selector; --- in all cases, we should check whether the objects (that own this metric) is matched (with name) --- only returns the latest value

- GetMetricBySelector --- if metric name is nominated, ignore the selector; --- otherwise, return all the metrics matched with the metric selector; --- in all cases, we should check whether the objects (that own this metric) is matched (with label selector)

- GetExternalMetric --- if metric name is nominated, ignore the metric selector; --- otherwise, return all the metrics matched with the metric selector;

type MetricProviderImp

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

func NewMetricProviderImp

func NewMetricProviderImp(ctx context.Context, storeImp store.MetricStore) *MetricProviderImp

func (*MetricProviderImp) GetExternalMetric

func (m *MetricProviderImp) GetExternalMetric(ctx context.Context, namespace string, metricSelector labels.Selector,
	info provider.ExternalMetricInfo) (*external_metrics.ExternalMetricValueList, error)

func (*MetricProviderImp) GetMetricByName

func (m *MetricProviderImp) GetMetricByName(ctx context.Context, namespacedName types.NamespacedName,
	info provider.CustomMetricInfo, metricSelector labels.Selector) (*custom_metrics.MetricValue, error)

func (*MetricProviderImp) GetMetricBySelector

func (m *MetricProviderImp) GetMetricBySelector(ctx context.Context, namespace string, objSelector labels.Selector,
	info provider.CustomMetricInfo, metricSelector labels.Selector) (*custom_metrics.MetricValueList, error)

func (*MetricProviderImp) ListAllExternalMetrics

func (m *MetricProviderImp) ListAllExternalMetrics() []provider.ExternalMetricInfo

func (*MetricProviderImp) ListAllMetrics

func (m *MetricProviderImp) ListAllMetrics() []provider.CustomMetricInfo

Jump to

Keyboard shortcuts

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