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

Avoid creation of multiple reporters #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mgaido91
Copy link

Due to an ambiguous semantic of the getReporter method of the Arguments class, extensions created around this project are forced to be using different reporters instances for their collectors and for the collectors in this repository. This prevents the reporter created for others' collectors to follow the proper lifecycle and hence to be correctly closed when needed, or anyway, makes them responsible to do so.

@CLAassistant
Copy link

CLAassistant commented Oct 16, 2019

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@hiboyang hiboyang left a comment

Choose a reason for hiding this comment

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

Thanks for the change. Maybe better to rename getReporter() to createReporter to make it more clearly. This method is actually intended to create a new reporter.

@mgaido91
Copy link
Author

@boy-uber thanks for your comment. I think the point of this PR is to be able to retrieve the reporter, in order to be able to reuse it to write customized metrics. Hence just renaming the method would not do the job. We can rename it, but having it as a singleton I think would be enabling for more use cases. Thanks.

@hiboyang
Copy link
Contributor

I see. It just looks weird that Arguments.java contains a Reporter field. If you want to reuse Reporter, I would suggest change it somewhere else. e.g. cache the reporter returned by Arguments somewhere.

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.

3 participants