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

Allow for customizable percentiles in extended statistics #230

Merged
merged 1 commit into from
Jul 26, 2018
Merged

Conversation

devonestes
Copy link
Collaborator

Before these were always set to 50 and 99, but now users can customize
the percentiles they want to see in extended statistics. We always need
the 50th percentile to get the median, so even if a user doesn't set
that, it will be calculated anyway.

Resolves #151

Copy link
Member

@PragTob PragTob left a comment

Choose a reason for hiding this comment

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

Thanks a lot and sorry for taking such a long time 🙏

I think we should put the configuration outside of the formatter.

First, right now the statistics code looks at formatter configuration (later layer) which I don't think is good + other formatters will want to display percentiles as well and therefore having it more global might be good.

I think nesting it under something like statistics makes sense so that we already had a place to put future statistics configuration - although that might never come so it might be premature.

(I was thinking about a feature to benchmark until a degree of confidence is reached not sure I'd put that under statistics but might be good)

@@ -124,6 +125,9 @@ defmodule Benchee.Configuration do
(x times slower than) is shown (true/false). Enabled by default.
* `extended_statistics` - display more statistics, aka `minimum`,
`maximum`, `sample_size` and `mode`. Disabled by default.
* `percentiles` - if you are using extended statistics and want to see the
results for certain percentiles of results beyond just the median.
Defaults to [50, 99] to calculate the 50th and 99th percentiles.
Copy link
Member

Choose a reason for hiding this comment

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

I think that's the wrong place to put it (sorry I had a lot going on so that this comment comes so late).

I think this should either be a top level configuration option or nested under statistics - the console formatter is wrong imo as it affects statistics and might be grabbed by multiple formatters.

}
}

assert ^expected = result
assert expected == result
Copy link
Member

Choose a reason for hiding this comment

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

👍


percentiles =
if is_nil(config) do
[50, 99]
Copy link
Member

Choose a reason for hiding this comment

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

we shouldn't need this with the appropriate default in the configuration right? I guess this was added to make testing less troublesome? I can support that but wonder if we could handle it differently 🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, we had some tests that didn't have a config, which was failing the tests. I've just looked at it again, and it's only 7 tests, so I might as well just update them so we can remove this check.

Before these were always set to 50 and 99, but now users can customize
the percentiles they want to see in extended statistics. We always need
the 50th percentile to get the median, so even if a user doesn't set
that, it will be calculated anyway.
Copy link
Member

@PragTob PragTob left a comment

Choose a reason for hiding this comment

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

sorry sometimes my notifcations don't seem to show me push updates
img_20180616_202903

@PragTob PragTob merged commit a8fd6db into master Jul 26, 2018
@devonestes devonestes deleted the Issue-51 branch July 27, 2018 04:20
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.

None yet

2 participants