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

Fixes 498 #499

Merged
merged 2 commits into from Nov 15, 2018
Merged

Fixes 498 #499

merged 2 commits into from Nov 15, 2018

Conversation

philipgough
Copy link
Contributor

@philipgough philipgough commented Nov 14, 2018

Fixes #498
@beorn7 is this close to what you had in mind? If not let me know and I can revise.

…tutil

Signed-off-by: PhilipGough <philip.p.gough@gmail.com>
Copy link
Member

@beorn7 beorn7 left a comment

Choose a reason for hiding this comment

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

Very nice, thanks. Just nits about the doc comment.

// text format and creates a readable error message from the result.
func notMatchingError(got, want []*dto.MetricFamily) error {
// compare encodes both provided slices of metric families into the
// text format compares their string message and returns an error if they do not match.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: commas after "format" and "message".

func notMatchingError(got, want []*dto.MetricFamily) error {
// compare encodes both provided slices of metric families into the
// text format compares their string message and returns an error if they do not match.
// In case of error, prints a readable error message from the result.
Copy link
Member

Choose a reason for hiding this comment

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

This sounds like it would call fmt.Println or something. Perhaps just mention that the returned error will contain the encoded text of both, got and want.

Signed-off-by: PhilipGough <philip.p.gough@gmail.com>
@philipgough
Copy link
Contributor Author

@beorn7 thanks, amended!

@beorn7
Copy link
Member

beorn7 commented Nov 15, 2018

Thanks, too. Merging now...

@beorn7 beorn7 merged commit 220bcf5 into prometheus:master Nov 15, 2018
@philipgough philipgough deleted the fixes-498 branch November 15, 2018 20:24
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.

Bug: testutil package unexpected results for Histograms
2 participants