Skip to content

Commit

Permalink
Use uniform sample to fix test flakes
Browse files Browse the repository at this point in the history
  • Loading branch information
bluekeyes committed Jul 20, 2023
1 parent b7b73b8 commit e556def
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion appmetrics/emitter/prometheus/collector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ histogram_min 8
r := metrics.NewRegistry()
c := NewCollector(r, WithTimerQuantiles([]float64{0.5, 0.9, 0.95, 0.99}))

timer := metrics.NewRegisteredTimer("timer", r)
timer := metrics.NewCustomTimer(metrics.NewHistogram(metrics.NewUniformSample(64)), metrics.NewMeter())
for _, i := range []int64{10, 9, 15, 12, 20, 28, 8, 12, 20, 16, 17, 27, 11, 10, 20, 21, 19, 18, 10, 26} {
timer.Update(time.Duration(i) * time.Millisecond)
}

_ = r.Register("timer", timer)

expected := `
# HELP timer_max_seconds metrics.Timer
# TYPE timer_max_seconds untyped
Expand Down

0 comments on commit e556def

Please sign in to comment.