slidingwindow

package
v0.1.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

README

功规

  • 统计滑动窗口内的操作信息

状态

  • 未测试:

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	Update(...any)
	Clear()
}

type SlidingWindow

type SlidingWindow struct {
	// contains filtered or unexported fields
}

func NewSlidingWindow

func NewSlidingWindow(timePerSlice time.Duration, winSize int64, bucketProvider func() Bucket) *SlidingWindow

func (*SlidingWindow) Clear

func (s *SlidingWindow) Clear()

func (*SlidingWindow) GetBuckets

func (s *SlidingWindow) GetBuckets() []Bucket

func (*SlidingWindow) Update

func (s *SlidingWindow) Update(values ...any)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL