Breaking down some more components, adding tests.

* Some bug fixes found during testing/test repair.
* Trying to tease apart the various responsibilities of `metricNamer` into smaller chunks and adding tests for each individual chunk.
* Updating the `provider_test` and `series_registry_test` to fix failures.
This commit is contained in:
Tony Compton 2018-07-19 10:53:48 -04:00
parent 76217a552b
commit fc88e6e57a
18 changed files with 1038 additions and 516 deletions

View file

@ -48,7 +48,9 @@ type prometheusProvider struct {
func NewPrometheusProvider(mapper apimeta.RESTMapper, kubeClient dynamic.Interface, promClient prom.Client, namers []MetricNamer, updateInterval time.Duration) (provider.CustomMetricsProvider, Runnable) {
basicLister := NewBasicMetricLister(promClient, namers, updateInterval)
periodicLister, periodicRunnable := NewPeriodicMetricLister(basicLister, updateInterval)
//TODO: Be sure to run this runnable.
// periodicLister, periodicRunnable := NewPeriodicMetricLister(basicLister, updateInterval)
periodicLister, _ := NewPeriodicMetricLister(basicLister, updateInterval)
seriesRegistry := NewBasicSeriesRegistry(periodicLister, mapper)