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

Make the relationship between the Reporter and Closeable interfaces explicit. #1307

Merged
merged 3 commits into from May 1, 2018

Conversation

tjcelaya
Copy link
Contributor

Resolves #1305 and reimplements #743. Credit to @obfischer for the initial implementation.

This makes it easier to denote that any Reporter is automatically Closeable when passing around the generic Reporter interface. Making the relationship explicit eases situations where a user may receive either a JmxReporter or some subclass of ScheduledReporter.

@tjcelaya
Copy link
Contributor Author

Pushed a fix for the codeclimate issue. There seems to be an unrelated test feailure in metrics-httpasyncclient though, not sure what to do about that.

Copy link
Member

@arteam arteam 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 pull request! I've left a suggestion to take a more defensive approach to evolving Reporter.

* @see ConsoleReporter
* @see CsvReporter
* @see Slf4jReporter
*/
public abstract class ScheduledReporter implements Closeable, Reporter {
public abstract class ScheduledReporter implements Reporter {
Copy link
Member

Choose a reason for hiding this comment

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

Please don't remove Closeable from ScheduledReporter, because the change is binary incompatible. That means we will force all 3rd reporters to upgrade to the latest version of metrics-core. I think it should be fine to just add Closeable to Reporter. It should be backward-compatible because ScheduledReporter and JmxReporter implement it already.

*/
public class JmxReporter implements Reporter, Closeable {
public class JmxReporter implements Reporter {
Copy link
Member

Choose a reason for hiding this comment

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

The same comment as for ScheduledReporter

Copy link
Member

@arteam arteam 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 pull request! I've left a suggestion to take a more defensive approach to evolving Reporter.

@arteam arteam added this to the 4.1.0 milestone Apr 28, 2018
@tjcelaya
Copy link
Contributor Author

I hadn't considered that removing the interface would cause problems but it makes sense. Updatd the PR to address the issue.

Also, the same metrics-httpasyncclient error seems to have occurred again.

@arteam
Copy link
Member

arteam commented Apr 30, 2018

Thanks, I will probably ignore httpasyncclient tests becase they fail constantly on Travis CI.

@arteam arteam merged commit 43da91e into dropwizard:4.1-development May 1, 2018
@arteam
Copy link
Member

arteam commented May 1, 2018

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants