latency

package
v0.0.0-...-24eec3b Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LatInfo

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

type LatManager

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

Not thread safe.

func NewLatManager

func NewLatManager(windowLen time.Duration, windowSize int) *LatManager

func (*LatManager) AddLat

func (lm *LatManager) AddLat(lat time.Duration)

Accepts latency in ns

func (*LatManager) GetAll95th

func (lm *LatManager) GetAll95th() int

Returns the 95th latency (in ms) from the beginning

func (*LatManager) GetAllPth

func (lm *LatManager) GetAllPth(p float64) int

Returns the specific percentile latency in ms

func (*LatManager) GetWindowP

func (lm *LatManager) GetWindowP(p float64) int64

Returns the specific percentile latency (in ms) of the current window

type LatPredictor

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

func NewLatPredictor

func NewLatPredictor(dstList []string, windowLen time.Duration, windowSize int) *LatPredictor

func (*LatPredictor) AddProbeRet

func (pm *LatPredictor) AddProbeRet(pr *ProbeRet)

func (*LatPredictor) PredictLat

func (pm *LatPredictor) PredictLat(addr string, p float64) int64

Returns the predicted roundtrip latency in ms

type ProbeRet

type ProbeRet struct {
	Addr string
	Rt   time.Duration // rountrip time
}

Jump to

Keyboard shortcuts

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