Skip to content

Commit

Permalink
micro-Nit in the test: don't make a private type public (#1510)
Browse files Browse the repository at this point in the history
  • Loading branch information
vagababov authored Jul 16, 2020
1 parent fa2ad62 commit 25f2aa6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions metrics/workqueue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@ func newFloat64(name string) *stats.Float64Measure {
return stats.Float64(name, "bar", "wtfs/s")
}

type FixedRateLimiter struct {
type fixedRateLimiter struct {
delay time.Duration
}

func (f *FixedRateLimiter) When(item interface{}) time.Duration {
func (f *fixedRateLimiter) When(item interface{}) time.Duration {
return f.delay
}

func (f *FixedRateLimiter) Forget(item interface{}) {}
func (f *fixedRateLimiter) Forget(item interface{}) {}

func (f *FixedRateLimiter) NumRequeues(item interface{}) int {
func (f *fixedRateLimiter) NumRequeues(item interface{}) int {
return 0
}

Expand Down Expand Up @@ -74,7 +74,7 @@ func TestWorkqueueMetrics(t *testing.T) {
defer view.Unregister(views...)

queueName := t.Name()
limiter := &FixedRateLimiter{delay: 200 * time.Millisecond}
limiter := &fixedRateLimiter{delay: 200 * time.Millisecond}
wq := workqueue.NewNamedRateLimitingQueue(limiter, queueName)

metricstest.CheckStatsNotReported(t, "adds", "depth", "latency", "retries", "work_duration",
Expand Down

0 comments on commit 25f2aa6

Please sign in to comment.