From 679bb113d80d96774d23b51bbb1b63bd1f0d814e Mon Sep 17 00:00:00 2001 From: Joe Lanford Date: Sun, 27 Oct 2019 23:52:22 -0400 Subject: [PATCH] pkg/metrics/workqueue.go: remove deprecated metrics Deprecated metrics from upstream k8s.io/client-go/util/workqueue were removed prior to 1.15, so they can now be safely removed from controller-runtime. See: https://github.com/kubernetes/client-go/commit/ee078c72e2013030bd1e38164e46bf2731f04176 --- pkg/metrics/workqueue.go | 49 ---------------------------------------- 1 file changed, 49 deletions(-) diff --git a/pkg/metrics/workqueue.go b/pkg/metrics/workqueue.go index 6381f0c14a..4baf817005 100644 --- a/pkg/metrics/workqueue.go +++ b/pkg/metrics/workqueue.go @@ -122,52 +122,3 @@ func (workqueueMetricsProvider) NewRetriesMetric(queue string) workqueue.Counter registerWorkqueueMetric(m, name, queue) return m } - -// TODO(abursavich): Remove the following deprecated metrics when they are -// removed from k8s.io/client-go/util/workqueue. - -func (workqueueMetricsProvider) NewDeprecatedLongestRunningProcessorMicrosecondsMetric(queue string) workqueue.SettableGaugeMetric { - const name = "workqueue_longest_running_processor_microseconds" - m := prometheus.NewGauge(prometheus.GaugeOpts{ - Name: name, - Help: "(Deprecated) How many microseconds has the longest running " + - "processor for workqueue been running.", - ConstLabels: prometheus.Labels{"name": queue}, - }) - registerWorkqueueMetric(m, name, queue) - return m -} - -// NOTE: The following deprecated metrics are noops because they were never -// included in controller-runtime. - -func (workqueueMetricsProvider) NewDeprecatedDepthMetric(queue string) workqueue.GaugeMetric { - return noopMetric{} -} - -func (workqueueMetricsProvider) NewDeprecatedAddsMetric(queue string) workqueue.CounterMetric { - return noopMetric{} -} - -func (workqueueMetricsProvider) NewDeprecatedLatencyMetric(queue string) workqueue.SummaryMetric { - return noopMetric{} -} - -func (workqueueMetricsProvider) NewDeprecatedWorkDurationMetric(queue string) workqueue.SummaryMetric { - return noopMetric{} -} - -func (workqueueMetricsProvider) NewDeprecatedUnfinishedWorkSecondsMetric(queue string) workqueue.SettableGaugeMetric { - return noopMetric{} -} - -func (workqueueMetricsProvider) NewDeprecatedRetriesMetric(queue string) workqueue.CounterMetric { - return noopMetric{} -} - -type noopMetric struct{} - -func (noopMetric) Inc() {} -func (noopMetric) Dec() {} -func (noopMetric) Set(float64) {} -func (noopMetric) Observe(float64) {}