MCPcopy
hub / github.com/prometheus/client_golang / BenchmarkHistogramNoLabels

Function BenchmarkHistogramNoLabels

prometheus/benchmark_test.go:219–230  ·  prometheus/benchmark_test.go::BenchmarkHistogramNoLabels
(b *testing.B)

Source from the content-addressed store, hash-verified

217}
218
219func BenchmarkHistogramNoLabels(b *testing.B) {
220 m := NewHistogram(HistogramOpts{
221 Name: "benchmark_histogram",
222 Help: "A histogram to benchmark it.",
223 },
224 )
225 b.ReportAllocs()
226 b.ResetTimer()
227 for i := 0; i < b.N; i++ {
228 m.Observe(3.1415)
229 }
230}
231
232func BenchmarkParallelCounter(b *testing.B) {
233 c := NewCounter(CounterOpts{

Callers

nothing calls this directly

Calls 2

ObserveMethod · 0.95
NewHistogramFunction · 0.70

Tested by

no test coverage detected