Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RollingWindow ¶
type RollingWindow struct {
// contains filtered or unexported fields
}
func New ¶
func New(size int, eachBucketTime time.Duration) *RollingWindow
New 计算当前时间所属window的开始时间, 以此时间为截止时间(采用时间bucket.startTime当标准), 返回之前一个窗口周期内的bucket
func (*RollingWindow) Add ¶
func (r *RollingWindow) Add(v float64)
func (*RollingWindow) Reduce ¶
func (r *RollingWindow) Reduce(fn ReduceFn)
Click to show internal directories.
Click to hide internal directories.