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

Function BenchmarkParallelCounter

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

Source from the content-addressed store, hash-verified

230}
231
232func BenchmarkParallelCounter(b *testing.B) {
233 c := NewCounter(CounterOpts{
234 Name: "benchmark_counter",
235 Help: "A Counter to benchmark it.",
236 })
237 b.ReportAllocs()
238 b.ResetTimer()
239 b.RunParallel(func(pb *testing.PB) {
240 for pb.Next() {
241 c.Inc()
242 }
243 })
244}

Callers

nothing calls this directly

Calls 2

IncMethod · 0.95
NewCounterFunction · 0.70

Tested by

no test coverage detected