func BenchmarkDieterbe(b *testing.B) { s := newServer() c, err := dieterbe.NewClient(true, addr, prefix) if err != nil { b.Fatal(err) } b.StartTimer() for i := 0; i < b.N; i++ { c.Increment(counterKey) c.Gauge(gaugeKey, gaugeValue) c.Timing(timingKey, tValInt64) } c.Close() b.StopTimer() s.Close() }
func BenchmarkDieterbeRaw(b *testing.B) { s := newServer() c, err := dieterbe.NewClient(true, addr, prefix) if err != nil { b.Fatal(err) } b.StartTimer() counter := []byte(fmt.Sprintf("%s:1|c", counterKey)) gauge := []byte(fmt.Sprintf("%s:%d|g", gaugeKey, gaugeValue)) timing := []byte(fmt.Sprintf("%s:%d|ms", timingKey, tValInt)) for i := 0; i < b.N; i++ { c.SendRaw(counter) c.SendRaw(gauge) c.SendRaw(timing) } c.Close() b.StopTimer() s.Close() }