Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLimitExceed = fmt.Errorf("limit exceed")
Functions ¶
This section is empty.
Types ¶
type BBR ¶
type BBR struct {
// contains filtered or unexported fields
}
BBR implements bbr-like limiter. It is inspired by sentinel. https://github.com/alibaba/Sentinel/wiki/%E7%B3%BB%E7%BB%9F%E8%87%AA%E9%80%82%E5%BA%94%E9%99%90%E6%B5%81
type Config ¶
type Config struct { Enabled bool Window time.Duration WinBucket int Rule string Debug bool CPUThreshold int64 }
Config contains configs of bbr limiter.
type CounterCache ¶
type CounterCache struct {
// contains filtered or unexported fields
}
CounterCache is used to cache maxPASS and minRt result. Value of current bucket is not counted in real time. Cache time is equal to a bucket duration.
Click to show internal directories.
Click to hide internal directories.