rlc:转到包以进行限速器收集

时间:2021-03-25 13:01:26
【文件属性】:
文件名称:rlc:转到包以进行限速器收集
文件大小:9KB
文件格式:ZIP
更新时间:2021-03-25 13:01:26
Go rlc Go的速率限制器集合。 挑选一个限速器来限制请求并控制配额。 RLC RLC是一个速率限制器,它根据先前请求的状态来管理配额,并相应地减慢或加速。 用法 offset := rlc . NewRandomOffset ( 96 ) // an RLC with the bitmap size of 96 with 16 reserved // positive bits and the random offset manager eq := rlc . NewRLC ( 96 , 16 , offset ) // non-blocking quota request haveQuota := eq . Ask () // update with ten previous successful requests eq . Notify ( true , 10 ) 基准测试 Be
【文件预览】:
rlc-master
----limiter.go(119B)
----slider_test.go(395B)
----go.mod(43B)
----token_bucket_test.go(416B)
----token_bucket.go(3KB)
----internal()
--------sweeper.go(466B)
----LICENSE(1KB)
----bench_test.go(2KB)
----slider.go(3KB)
----README.md(3KB)
----offset.go(1KB)
----.gitignore(129B)
----rlc.go(3KB)
----rlc_test.go(1KB)

网友评论