Skip to content

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