From 10476265b67efaed95bad85354d6f0de0adf867a Mon Sep 17 00:00:00 2001 From: jiaozilang Date: Sun, 10 Oct 2021 15:36:19 +0800 Subject: [PATCH] doc(circuit_breaker): add ema wiki link --- docs/cn/circuit_breaker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/cn/circuit_breaker.md b/docs/cn/circuit_breaker.md index 0a06fa8a07..cfdafeda9d 100644 --- a/docs/cn/circuit_breaker.md +++ b/docs/cn/circuit_breaker.md @@ -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。