Skip to content

Instantly share code, notes, and snippets.

@hagen1778
Created October 29, 2025 14:20
Show Gist options
  • Select an option

  • Save hagen1778/0c5afe81c91f72ec61114580fc68898e to your computer and use it in GitHub Desktop.

Select an option

Save hagen1778/0c5afe81c91f72ec61114580fc68898e to your computer and use it in GitHub Desktop.
import (
"testing"
)
func BenchmarkPrometheusCounter(b *testing.B) {
promCounter := PromRequestsCounter.WithLabelValues("200")
for i := 0; i < b.N; i++ {
promCounter.Inc()
}
}
func BenchmarkVictoriaMetricsCounter(b *testing.B) {
for i := 0; i < b.N; i++ {
VMRequestsCounter.Inc()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment