alexcesaro/statsd

Timing.Send value should be float instead of int

taozle opened this issue · 0 comments

Original:

// Send sends the time elapsed since the creation of the Timing.
func (t Timing) Send(bucket string) {
	t.c.Timing(bucket, int(t.Duration()/time.Millisecond))
}

Because int(t.Duration()/time.Millisecond) will be 0 if t.Duration is less than int(time.Millisecond), so we should correct it like this

// Send sends the time elapsed since the creation of the Timing.
func (t Timing) Send(bucket string) {
	t.c.Timing(bucket, t.Duration().Seconds()*1e3)
}