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

Function BenchmarkSummaryNoLabels

prometheus/benchmark_test.go:190–202  ·  view source on GitHub ↗
(b *testing.B)

Source from the content-addressed store, hash-verified

188}
189
190func BenchmarkSummaryNoLabels(b *testing.B) {
191 m := NewSummary(SummaryOpts{
192 Name: "benchmark_summary",
193 Help: "A summary to benchmark it.",
194 Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001},
195 },
196 )
197 b.ReportAllocs()
198 b.ResetTimer()
199 for i := 0; i < b.N; i++ {
200 m.Observe(3.1415)
201 }
202}
203
204func BenchmarkHistogramWithLabelValues(b *testing.B) {
205 m := NewHistogramVec(

Callers

nothing calls this directly

Calls 2

ObserveMethod · 0.95
NewSummaryFunction · 0.70

Tested by

no test coverage detected