()
| 27 | }) |
| 28 | |
| 29 | func ExampleTimer() { |
| 30 | // timer times this example function. It uses a Histogram, but a Summary |
| 31 | // would also work, as both implement Observer. Check out |
| 32 | // https://prometheus.io/docs/practices/histograms/ for differences. |
| 33 | timer := prometheus.NewTimer(requestDuration) |
| 34 | defer timer.ObserveDuration() |
| 35 | |
| 36 | // Do something here that takes time. |
| 37 | time.Sleep(time.Duration(rand.NormFloat64()*10000+50000) * time.Microsecond) |
| 38 | } |
nothing calls this directly
no test coverage detected