Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timing.Send value should be float instead of int #26

Open
taozle opened this issue Jun 21, 2017 · 0 comments
Open

Timing.Send value should be float instead of int #26

taozle opened this issue Jun 21, 2017 · 0 comments

Comments

@taozle
Copy link

taozle commented Jun 21, 2017

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)
}
astromechza added a commit to astromechza/go-statsd that referenced this issue Dec 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant