Git Product home page Git Product logo

Comments (2)

sczyh30 avatar sczyh30 commented on May 10, 2024 2

Sentinel 指标统计的滑动窗口中每个小窗口的初始时间都是经过对齐的(间隔默认 500 ms),而不是当前时间,因此会存在时间偏差导致多通过的情况。

比如流量的时间范围(取后四位):1258 - 2258

理想的情况是:

   瞬间20个请求            这段时间无法通过
       ↓                       ↓
   |    o               |                    |
 1258                  1758                 2258    (windowStart)

但实际的窗口是:

   瞬间20个请求            这段时间无法通过  第一个窗口过期,因此又可以进入 20 个
        ↓                       ↓              ↓
   |    o               |                    |  o                  |
 1000                  1500                 2000                 2500  (windowStart)

from sentinel.

xflonga avatar xflonga commented on May 10, 2024

感谢回答。

我理解了,然后今天看了下这一块的代码,sentinel是以500ms为一个时间监控窗口,所以我问题中所描述的2倍其实也不准确,只是因为我测试的时间少,使得增加的起始时间片段和结束时间片段的qps刚好和qps一样。。

from sentinel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.