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

circuit breaker metrics tracking #139

Merged
merged 1 commit into from
Apr 14, 2016

Conversation

synk
Copy link
Contributor

@synk synk commented Apr 8, 2016

Changes

  • Add CircuitBreakerListener interface to track circuit breaker stats.
  • Add a metrics monitoring implementation using dropwizard metrics.
  • Make CircuitState and EventCount public to use from CircuitBreakerListener definition.

@synk synk force-pushed the develop-circuitbreaker-monitor branch 2 times, most recently from 5ea93ac to 0273698 Compare April 8, 2016 11:45
@synk synk force-pushed the develop-circuitbreaker-monitor branch 2 times, most recently from ec3aadc to fbbc9a1 Compare April 9, 2016 11:52
@@ -223,7 +240,7 @@ public CircuitBreaker build() {
new CircuitBreakerConfig(name, failureRateThreshold, minimumRequestThreshold,
circuitOpenWindow, trialRequestInterval,
counterSlidingWindow, counterUpdateInterval,
exceptionFilter));
exceptionFilter, listeners));
Copy link
Member

Choose a reason for hiding this comment

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

Wrap with Collections.unmodifiableList()?

@synk synk force-pushed the develop-circuitbreaker-monitor branch 2 times, most recently from 8dcab5b to f1fdb7e Compare April 11, 2016 09:09
@trustin trustin added this to the 0.14.0.Final milestone Apr 12, 2016
/**
* Invoked when the circuit state is changed.
*/
void onStateChanged(CircuitBreaker circuitBreaker, CircuitState state);
Copy link
Member

Choose a reason for hiding this comment

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

How about adding throws Exception to all listener methods so that a user doesn't need to catch boring checked exceptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because CircuitBreakerListener will be called from the core of the circuit breaker directly, That should be carefully implemented. IMO, It would be better that listeners handle the exceptions by them self.
But It is reasonable to add the throws to be consistent with armeria's policy!

Copy link
Member

Choose a reason for hiding this comment

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

There's always a chance of throwing a RuntimeException regardless we added throws Exception or not. :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see

@synk synk force-pushed the develop-circuitbreaker-monitor branch from f1fdb7e to 9dd89e6 Compare April 13, 2016 03:56
@trustin trustin merged commit 389b35b into line:master Apr 14, 2016
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