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

Functional options api #20

Merged
merged 17 commits into from
Oct 25, 2020
Merged

Functional options api #20

merged 17 commits into from
Oct 25, 2020

Conversation

arl
Copy link
Owner

@arl arl commented Oct 25, 2020

Improve public API, which remains 100% compatible, by adding functional options to Register.
At the moment, options are:

  • Root(root string) -> allow to change handler root (for example to have statsviz at http://host:port/my/special/statsviz/path rather than /debug/statsviz

  • SendFrequency(freq time.Duration) -> allow to specify a different frequency for sending the runtime stats from the application to the user interface (default is 1s). Note that at the moment the user interface keeps track of 60 points, whatever is the frequency.

Improve code organization.
Add handler tests
Fix a data race (appearing in parallel tests). On non-test code, you would have had to register handlers twice to see that. Anyway it's fixed

@arl arl merged commit 39c43bb into master Oct 25, 2020
@arl arl deleted the functional-options-api branch October 25, 2020 15:44
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.

1 participant