Allow custom metric provider for retry metrics

Kubernetes-commit: a60624ffbc265d61b35cab16ea9ded485909f3ed
This commit is contained in:
austin ce
2023-03-10 17:48:10 -05:00
committed by Kubernetes Publisher
parent 66fa9d308f
commit 21b4553e44
3 changed files with 11 additions and 6 deletions

View File

@@ -71,7 +71,7 @@ func NewDelayingQueueWithConfig(config DelayingQueueConfig) DelayingInterface {
})
}
return newDelayingQueue(config.Clock, config.Queue, config.Name)
return newDelayingQueue(config.Clock, config.Queue, config.Name, config.MetricsProvider)
}
// NewDelayingQueueWithCustomQueue constructs a new workqueue with ability to
@@ -100,14 +100,14 @@ func NewDelayingQueueWithCustomClock(clock clock.WithTicker, name string) Delayi
})
}
func newDelayingQueue(clock clock.WithTicker, q Interface, name string) *delayingType {
func newDelayingQueue(clock clock.WithTicker, q Interface, name string, provider MetricsProvider) *delayingType {
ret := &delayingType{
Interface: q,
clock: clock,
heartbeat: clock.NewTicker(maxWait),
stopCh: make(chan struct{}),
waitingForAddCh: make(chan *waitFor, 1000),
metrics: newRetryMetrics(name),
metrics: newRetryMetrics(name, provider),
}
go ret.waitingLoop()