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

Set time unit on metrics.Timer #610

Merged
merged 2 commits into from
Sep 17, 2017
Merged

Conversation

esenac
Copy link
Contributor

@esenac esenac commented Sep 15, 2017

Issue #608.

Copy link
Member

@peterbourgon peterbourgon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Couple of small things before I can merge. The CI failures look unrelated, I'll try to fix those.

metrics/timer.go Outdated
if d < 0 {
d = 0
}
t.h.Observe(d)
}

// Unit sets the timer time unit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make this a proper sentence with punctuation, and provide more detail, e.g.

Unit sets the unit of the float64 emitted by the timer. By default, the timer emits seconds.

@@ -31,3 +31,29 @@ func TestTimerSlow(t *testing.T) {
t.Errorf("want %.3f, have %.3f", want, have)
}
}

func TestTimerUnit(t *testing.T) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove extraneous newline.

@esenac
Copy link
Contributor Author

esenac commented Sep 15, 2017

Thanks for your feedback @peterbourgon! I implemented the suggested changes, please have a further review.

@peterbourgon
Copy link
Member

Thanks! Test failures are unrelated.

@peterbourgon peterbourgon merged commit b5c889e into go-kit:master Sep 17, 2017
jamesgist pushed a commit to jamesgist/kit that referenced this pull request Nov 1, 2024
Set time unit on metrics.Timer
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

Successfully merging this pull request may close these issues.

2 participants