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

report: HDR Histogram plot output format #413

Merged
merged 3 commits into from
Jul 19, 2019
Merged

report: HDR Histogram plot output format #413

merged 3 commits into from
Jul 19, 2019

Conversation

tsenart
Copy link
Owner

@tsenart tsenart commented Jun 17, 2019

@tsenart tsenart requested a review from xla as a code owner June 17, 2019 19:08
@tsenart tsenart mentioned this pull request Jun 17, 2019
3 tasks
if err := hist.Buckets.UnmarshalText([]byte(typ[4:])); err != nil {
return err
}
rep, report = vegeta.NewHistogramReporter(&hist), &hist

Choose a reason for hiding this comment

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

ineffectual assignment to rep (from ineffassign)

Copy link
Contributor

@fxkr fxkr left a comment

Choose a reason for hiding this comment

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

  • needs README update.

Other than that lgtm. I like that this turned out to be easier than I expected. Caveat - I just looked at the code; didn't find the time to test it yet.


var hdrHeader = []byte("Value Percentile TotalCount 1/(1-Percentile)\n\n")

var logarithmic = []float64{
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain how these magic values were chosen (preferably in a code comment)?

If they come from hdrhistogram it should be ok to keep them (with a comment), but if you picked them yourself I think it would be nicer to calculate them on startup.

Copy link
Owner Author

Choose a reason for hiding this comment

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

lib/reporters.go Outdated Show resolved Hide resolved
lib/reporters.go Outdated Show resolved Hide resolved
if q < 1.0 {
return 1 / (1 - q)
}
return float64(10000000)
Copy link
Contributor

Choose a reason for hiding this comment

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

Where's this constant coming from? (Comment would be helpful)

Copy link
Owner Author

Choose a reason for hiding this comment

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

I am not sure. https://github.com/tylertreat/hdrhistogram-writer/blob/master/writer.go#L65

I assume that's a constant used to indicate the upper bound of the 1 by quantile column.

default:
switch {
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not understand why this change is being made as part of this PR?

Copy link
Owner Author

Choose a reason for hiding this comment

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

We no longer want to assume a length prefix of the typ variable.

report.go Outdated
return err
}
rep, report = vegeta.NewHistogramReporter(&hist), &hist
}
return fmt.Errorf("unknown report type: %q", typ)
Copy link
Contributor

Choose a reason for hiding this comment

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

With this change you'll always return the error for -typ=hist, as you have no return after the rep, report = line.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks, good catch!

@tsenart tsenart force-pushed the core/hdr-reporter branch 2 times, most recently from 196a9b5 to 342105a Compare June 29, 2019 09:03
@tsenart tsenart force-pushed the core/hdr-reporter branch from 342105a to cbbec37 Compare June 29, 2019 09:08
@tsenart tsenart force-pushed the core/hdr-reporter branch from a870361 to 89e82de Compare June 29, 2019 09:20
@tsenart
Copy link
Owner Author

tsenart commented Jun 29, 2019

@fxkr: Please take another look.

@tsenart tsenart merged commit 97cae82 into master Jul 19, 2019
@tsenart tsenart deleted the core/hdr-reporter branch July 19, 2019 10:29
@ruiaraujo
Copy link

Looking forward to have this released!

@tsenart many thanks for doing this 😃

@tsenart
Copy link
Owner Author

tsenart commented Jul 19, 2019 via email

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.

4 participants