Skip to content

Commit

Permalink
doc(circuit_breaker): add ema wiki link
Browse files Browse the repository at this point in the history
  • Loading branch information
JiaoZiLang committed Oct 10, 2021
1 parent e3a4c06 commit 1047626
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/cn/circuit_breaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ option.enable_circuit_breaker = true;
可选的熔断由CircuitBreaker实现,在开启了熔断之后,CircuitBreaker会记录每一个请求的处理结果,并维护一个累计出错时长,记为acc_error_cost,当acc_error_cost > max_error_cost时,熔断该节点。

**每次请求返回成功之后,更新max_error_cost:**
1. 首先需要更新latency的EMA值,记为ema_latency: ema_latency = ema_latency * alpha + (1 - alpha) * latency。
1. 首先需要更新latency的[EMA](https://en.wikipedia.org/wiki/Moving_average),记为ema_latency: ema_latency = ema_latency * alpha + (1 - alpha) * latency。
2. 之后根据ema_latency更新max_error_cost: max_error_cost = window_size * max_error_rate * ema_latency。


Expand Down

0 comments on commit 1047626

Please sign in to comment.