Documentation ¶
Index ¶
- type MetricStore
- func (s *MetricStore) GetExternalMetric(namespace string, selector labels.Selector, info provider.ExternalMetricInfo) (*external_metrics.ExternalMetricValueList, error)
- func (s *MetricStore) Insert(value collector.CollectedMetric)
- func (s *MetricStore) ListAllExternalMetrics() []provider.ExternalMetricInfo
- func (s *MetricStore) RemoveExpired()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MetricStore ¶
MetricStore is a simple in-memory Metrics Store for HPA metrics.
func NewMetricStore ¶
func NewMetricStore(ttlCalculator func() time.Time) *MetricStore
NewMetricStore initializes an empty Metrics Store.
func (*MetricStore) GetExternalMetric ¶
func (s *MetricStore) GetExternalMetric(namespace string, selector labels.Selector, info provider.ExternalMetricInfo) (*external_metrics.ExternalMetricValueList, error)
GetExternalMetric gets external metric from the store by metric name and selector.
func (*MetricStore) Insert ¶
func (s *MetricStore) Insert(value collector.CollectedMetric)
Insert inserts a collected metric into the metric customMetricsStore.
func (*MetricStore) ListAllExternalMetrics ¶
func (s *MetricStore) ListAllExternalMetrics() []provider.ExternalMetricInfo
ListAllExternalMetrics lists all external metrics in the Metrics Store.
func (*MetricStore) RemoveExpired ¶
func (s *MetricStore) RemoveExpired()
RemoveExpired removes expired metrics from the Metrics Store. A metric is considered expired if its metricsTTL is before time.Now().
Click to show internal directories.
Click to hide internal directories.