Closed imkira closed 9 years ago
+1
On Tuesday, March 24, 2015, Mário Freitas notifications@github.com wrote:
Is there any reason why there is no official way of stopping a reporter once you have called its reporting function?
Example (Log reporter):
https://github.com/rcrowley/go-metrics/blob/master/log.go#L10
In order to be more test-friendly and to be able to gracefully stop metric reporting it would be cool to have such feature. I could try working on a PR for this. What do you think?
— Reply to this email directly or view it on GitHub https://github.com/rcrowley/go-metrics/issues/110.
Sent from Gmail Mobile
I'd happily review a PR, but I'm not 100% sure it's worth the effort - reporting is usually not a critical component of the application, and all resources associated with it get released when the process exits. It would have to be an extremely clean, low impact patch where existing implementations such as the logger could remain very simple.
I think @rcrowley originally avoided introducing a special reporter interface because they all have subtly different needs. It may make even less sense as I start to enforce this policy
Closing until there's a PR to discuss. Thanks!
Is there any reason why there is no official way of stopping a reporter once you have called its reporting function?
Example (Log reporter):
https://github.com/rcrowley/go-metrics/blob/master/log.go#L10
In order to be more test-friendly and to be able to gracefully stop metric reporting it would be cool to have such feature. I could try working on a PR for this. What do you think?