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

Function BenchmarkCounterNoLabels

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

Source from the content-addressed store, hash-verified

133}
134
135func BenchmarkCounterNoLabels(b *testing.B) {
136 m := NewCounter(CounterOpts{
137 Name: "benchmark_counter",
138 Help: "A counter to benchmark it.",
139 })
140 b.ReportAllocs()
141 b.ResetTimer()
142 for i := 0; i < b.N; i++ {
143 m.Inc()
144 }
145}
146
147func BenchmarkGaugeWithLabelValues(b *testing.B) {
148 m := NewGaugeVec(

Callers

nothing calls this directly

Calls 2

IncMethod · 0.95
NewCounterFunction · 0.70

Tested by

no test coverage detected