The Go Programming Language
› http://golang.org/
› Go Playground
Go Projects
› Revel Web Framework
roy2220

实现一个高效的滑动时间窗口计数器

  •  1
     
  •   roy2220 · Jan 27, 2023 · 3514 views
    This topic created in 1381 days ago, the information mentioned may be changed or developed.

    适合用于计算最近一段时间的样本均值

    典型应用场景:成功率限流、QPS 限流

    https://github.com/go-tk/stw

    10 replies  •  2023-01-29 10:33:22 +08:00
    toomoy
    toomoy
    Jan 27, 2023
    1
    集群做不到统一滑动吧?
    melkor
    melkor
    Jan 27, 2023 via iPhone
    2
    @toomoy 当然是各自滑各自的
    slowman
    slowman
    Jan 27, 2023
    3
    没有 benchmark 怎么能说高效呢
    GopherDaily
    GopherDaily
    Jan 28, 2023
    4
    为什么有成熟稳定大规模落地的东西不直接用呢?

    退一步将,大多数时候看汽车轮子比造牛车轮子的收益大很多
    Nazz
    Nazz
    Jan 28, 2023
    5
    普罗米修斯怎么样
    julyclyde
    julyclyde
    Jan 28, 2023
    6
    @GopherDaily 评职称
    roy2220
    roy2220
    OP
    Jan 28, 2023 via iPhone
    7
    @GopherDaily 关于滑动时间窗口计数器,我的实现思路非常"取巧",代码短少,翻了一下 github 还没找到和我思路类似的实现,可以把你认为成熟实现贴出来和大家分享
    ddd1
    ddd1
    Jan 28, 2023
    8
    roy2220
    roy2220
    OP
    Jan 28, 2023
    9
    @ddd1 已经看过了,你能说说 sentinel-golang 实现的滑动时间窗口有啥亮点吗?
    ddd1
    ddd1
    Jan 29, 2023
    10
    @roy2220 没做过对比
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   668 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 23:25 · PVG 07:25 · LAX 15:25 · JFK 18:25
    ♥ Do have faith in what you're doing.