Explorar o código

Add parallel bench test for gauge_float64

Ralph Caraveo %!s(int64=7) %!d(string=hai) anos
pai
achega
7f3de8a89d
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      gauge_float64_test.go

+ 10 - 0
gauge_float64_test.go

@@ -10,6 +10,16 @@ func BenchmarkGuageFloat64(b *testing.B) {
 	}
 }
 
+func BenchmarkGuageFloat64Parallel(b *testing.B) {
+	g := NewGaugeFloat64()
+	b.ResetTimer()
+	b.RunParallel(func(pb *testing.PB) {
+		for pb.Next() {
+			g.Update(float64(1))
+		}
+	})
+}
+
 func TestGaugeFloat64(t *testing.T) {
 	g := NewGaugeFloat64()
 	g.Update(float64(47.0))