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

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

  •  1
     
  •   roy2220 · Jan 27, 2023 · 2851 views
    This topic created in 1202 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
        1
    toomoy  
       Jan 27, 2023
    集群做不到统一滑动吧?
    melkor
        2
    melkor  
       Jan 27, 2023 via iPhone
    @toomoy 当然是各自滑各自的
    slowman
        3
    slowman  
       Jan 27, 2023
    没有 benchmark 怎么能说高效呢
    GopherDaily
        4
    GopherDaily  
       Jan 28, 2023
    为什么有成熟稳定大规模落地的东西不直接用呢?

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