provider

package
v0.0.0-...-ddcacec Latest Latest
Warning

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

Go to latest
Published: May 27, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricStore

type MetricStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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().

Jump to

Keyboard shortcuts

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