ratecalculator

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWindowSize  = 1000
	DefaultBpsScale    = 8000
	DefaultWindowItems = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RateCalculator

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

func NewRateCalculator

func NewRateCalculator(windowSizeMs int, scale float64, windowItems int32, logger *zap.Logger) *RateCalculator

func (RateCalculator) GetBytes

func (p RateCalculator) GetBytes() int64

func (*RateCalculator) GetRate

func (p *RateCalculator) GetRate(nowMs int64) uint32

func (*RateCalculator) Update

func (p *RateCalculator) Update(size int, nowMs int64)

Jump to

Keyboard shortcuts

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