From 5b4676629002ef99a0e5edad57748b329095dfc9 Mon Sep 17 00:00:00 2001 From: wtifs Date: Mon, 30 Oct 2023 20:20:27 +0800 Subject: [PATCH] doc: add docs --- plugin/ratelimiter/bbr/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/plugin/ratelimiter/bbr/README.md b/plugin/ratelimiter/bbr/README.md index 4bae4c20..d9f909e4 100644 --- a/plugin/ratelimiter/bbr/README.md +++ b/plugin/ratelimiter/bbr/README.md @@ -44,3 +44,12 @@ func (l *BBR) maxInFlight() int64 { - `l.minRT()` 为 单个采样窗口中最小的响应时间 - 0.5为向上取整 - 则上述公式表示每毫秒能同时处理的最多请求数。用当前并发请求数 `inFlight` 与计算值比较,判断是否触发限流 + +## 代码结构 +```go +├── core BBR核心算法实现 +├── cpu CPU使用率采集相关实现 +├── window 滑动窗口相关实现 +├── bucket.go 实现 `QuotaBucket` 接口 +├── plugin.go 实现 `Plugin` 接口 +```