Documentation ¶
Index ¶
- func PackExternalMetricValue(metricItem types.Metric, metric types.Item) *external_metrics.ExternalMetricValue
- func PackExternalMetricValueList(metricItem types.Metric) []external_metrics.ExternalMetricValue
- func PackMetricValue(m types.Metric, item types.Item, metricSelector labels.Selector) *custom_metrics.MetricValue
- func PackMetricValueList(metricItem types.Metric, metricSelector labels.Selector) []custom_metrics.MetricValue
- type DummyMetricQuery
- func (d DummyMetricQuery) GetExternalMetric(_ context.Context, _ string, _ labels.Selector, _ provider.ExternalMetricInfo) (*external_metrics.ExternalMetricValueList, error)
- func (d DummyMetricQuery) GetMetricByName(_ context.Context, _ types.NamespacedName, _ provider.CustomMetricInfo, ...) (*custom_metrics.MetricValue, error)
- func (d DummyMetricQuery) GetMetricBySelector(_ context.Context, _ string, _ labels.Selector, _ provider.CustomMetricInfo, ...) (*custom_metrics.MetricValueList, error)
- func (d DummyMetricQuery) ListAllExternalMetrics() []provider.ExternalMetricInfo
- func (d DummyMetricQuery) ListAllMetrics() []provider.CustomMetricInfo
- type MetricProvider
- type MetricProviderImp
- func (m *MetricProviderImp) GetExternalMetric(ctx context.Context, namespace string, metricSelector labels.Selector, ...) (*external_metrics.ExternalMetricValueList, error)
- func (m *MetricProviderImp) GetMetricByName(ctx context.Context, namespacedName apitypes.NamespacedName, ...) (*custom_metrics.MetricValue, error)
- func (m *MetricProviderImp) GetMetricBySelector(ctx context.Context, namespace string, objSelector labels.Selector, ...) (*custom_metrics.MetricValueList, error)
- func (m *MetricProviderImp) ListAllExternalMetrics() []provider.ExternalMetricInfo
- func (m *MetricProviderImp) ListAllMetrics() []provider.CustomMetricInfo
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) GetExternalMetric ¶
func (d DummyMetricQuery) GetExternalMetric(_ context.Context, _ string, _ labels.Selector, _ provider.ExternalMetricInfo, ) (*external_metrics.ExternalMetricValueList, error)
func (DummyMetricQuery) GetMetricByName ¶
func (d DummyMetricQuery) GetMetricByName(_ context.Context, _ types.NamespacedName, _ provider.CustomMetricInfo, _ labels.Selector, ) (*custom_metrics.MetricValue, error)
func (DummyMetricQuery) GetMetricBySelector ¶
func (d DummyMetricQuery) GetMetricBySelector(_ context.Context, _ string, _ labels.Selector, _ provider.CustomMetricInfo, _ labels.Selector, ) (*custom_metrics.MetricValueList, error)
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