Skip to content
Permalink
Browse files

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: kubernetes/client-go@ee078c7
  • Loading branch information
joelanford committed Oct 28, 2019
1 parent ad57a97 commit 679bb113d80d96774d23b51bbb1b63bd1f0d814e
Showing with 0 additions and 49 deletions.
  1. +0 −49 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) {}

0 comments on commit 679bb11

Please sign in to comment.
You can’t perform that action at this time.