Open mgaido91 opened 5 years ago
@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.
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.
Due to an ambiguous semantic of the
getReporter
method of theArguments
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.