Exemplo n.º 1
1
func BenchmarkAlexcesaro(b *testing.B) {
	s := newServer()
	c, err := alexcesaro.New(addr, alexcesaro.WithPrefix(prefix), alexcesaro.WithFlushPeriod(flushPeriod))
	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, tValInt, 1)
	}
	c.Close()
	b.StopTimer()
	s.Close()
}
Exemplo n.º 2
0
func ExampleWithFlushPeriod() {
	statsd.New(":8125", statsd.WithFlushPeriod(10*time.Millisecond))
}