Skip to content

Conversation

zentol
Copy link
Contributor

@zentol zentol commented Jun 15, 2016

  • adds a cancel flag to the StatsDReporter, which is checked before sending every metric. set to true when stop() is called.
  • switched from Timer to ScheduledExecutorService, in the hopes of better forced termination.
  • also contains a hotfix preventing exceptions occurring in (un)register to be propagated

reporter.notifyOfAddedMetric(metric, metricName, group);
}
} catch (Exception e) {
LOG.error("Error while registering metric.", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we add the try-catch here? notifyOfAddedMetric does not declare thrown exceptions. Thus we try to catch unchecked exceptions here? Which unchecked exceptions did you encounter here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is simply a fail-safe to ensure that no exceptions are thrown. Generally a reporter shouldn't throw an Exception in these methods, but I'd rather be safe then sorry.

@tillrohrmann
Copy link
Contributor

Good improvements to make the Reporters less blocking @zentol. I had only some minor comments. After addressing them, I think the PR is good to be merged :-)

zentol added 2 commits June 22, 2016 13:43
-executor only started when needed
-executor properly shutdown
-renamed cancel flag to closed
@zentol
Copy link
Contributor Author

zentol commented Jun 24, 2016

@tillrohrmann Addressed all your comments.

@tillrohrmann
Copy link
Contributor

Very good work @zentol.

+1 for merging.

@zentol
Copy link
Contributor Author

zentol commented Jun 27, 2016

merging

@asfgit asfgit closed this in 56cdec7 Jun 27, 2016
@zentol zentol deleted the metrics_blocking_reporter branch June 27, 2016 11:09
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.

3 participants