-
Notifications
You must be signed in to change notification settings - Fork 8k
Circuit Breaking
Eric Zhao edited this page Aug 21, 2020
·
5 revisions
Circuit breaking provides stability and prevents cascading failures in distributed systems.
Note: This document is for Sentinel 1.8.0 or above.
- Slow Request Ratio: Circuit breaking by slow request ratio. We'll need to provide the "upper-bound response time", and requests whose RT exceeds the upper-bound RT will be recorded as a slow request.
- Error Ratio: Circuit breaking by the error ratio (error count / total completed count).
- Error Count: Circuit breaking by the number of exceptions.
For circuit breaking rules, you can refer to here.
EventObserverRegistry.getInstance().addStateChangeObserver("logging",
(prevState, newState, rule, snapshotValue) -> {
if (newState == State.OPEN) {
System.err.println(String.format("%s -> OPEN at %d, snapshotValue=%.2f", prevState.name(),
TimeUtil.currentTimeMillis(), snapshotValue));
} else {
System.err.println(String.format("%s -> %s at %d", prevState.name(), newState.name(),
TimeUtil.currentTimeMillis()));
}
});
-
文档
-
Documents
- Read Me
- Introduction
- How to Use
- How it Works
- Flow Control
- Parameter Flow Control
- Cluster Flow Control
- API Gateway Flow Control
- Circuit Breaking
- Adaptive System Protection
- Metrics
- General Configuration
- Dynamic Rule Configuration
- Dashboard
- Integrations with open-source frameworks
- Contribution Guideline