provider

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PackExternalMetricValue

func PackExternalMetricValue(metricItem types.Metric, metric types.Item) *external_metrics.ExternalMetricValue

func PackExternalMetricValueList

func PackExternalMetricValueList(metricItem types.Metric) []external_metrics.ExternalMetricValue

func PackMetricValue

func PackMetricValue(m types.Metric, item types.Item, metricSelector labels.Selector) *custom_metrics.MetricValue

func PackMetricValueList

func PackMetricValueList(metricItem types.Metric, metricSelector labels.Selector) []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, baseCtx *katalyst_base.GenericContext, 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 apitypes.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