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

Function BenchmarkGaugeNoLabels

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

Source from the content-addressed store, hash-verified

160}
161
162func BenchmarkGaugeNoLabels(b *testing.B) {
163 m := NewGauge(GaugeOpts{
164 Name: "benchmark_gauge",
165 Help: "A gauge to benchmark it.",
166 })
167 b.ReportAllocs()
168 b.ResetTimer()
169 for i := 0; i < b.N; i++ {
170 m.Set(3.1415)
171 }
172}
173
174func BenchmarkSummaryWithLabelValues(b *testing.B) {
175 m := NewSummaryVec(

Callers

nothing calls this directly

Calls 2

SetMethod · 0.95
NewGaugeFunction · 0.70

Tested by

no test coverage detected