rtt

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SlidingWindowHistogram

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

SlidingWindowHistogram maintains a histogram over a sliding window of data.

func NewSlidingWindowHistogram

func NewSlidingWindowHistogram(size int) *SlidingWindowHistogram

NewSlidingWindowHistogram creates a new SlidingWindowHistogram with a given size.

func (*SlidingWindowHistogram) Add

func (h *SlidingWindowHistogram) Add(value float64)

Add adds a new value to the histogram, sliding the window if necessary.

func (*SlidingWindowHistogram) Mean

func (h *SlidingWindowHistogram) Mean() float64

Mean calculates the mean of the data in the window.

func (*SlidingWindowHistogram) Min

Min calculates the minimum value of the data in the window.

func (*SlidingWindowHistogram) StdDev

func (h *SlidingWindowHistogram) StdDev() float64

StdDev calculates the standard deviation of the data in the window.

type TCPStats

type TCPStats struct {
	SRTT   float64 // Smoothed RTT
	RTTVAR float64 // RTT variance

	RTO float64 // Retransmission timeout

	K float64 // Factor to multiply with RTTVAR
	// contains filtered or unexported fields
}

TCPStats holds TCP RTT related statistics.

func NewTCPStats

func NewTCPStats(initialRTO float64, minRTTVAR float64, alpha float64, beta float64, minRTO float64, maxRTO float64, K float64, histSize int) TCPStats

NewTCPStats initializes the TCPStats with the first RTT measurement.

func (*TCPStats) GetBaseRTT

func (t *TCPStats) GetBaseRTT() float64

GetBaseRTT returns the base RTT.

func (*TCPStats) UpdateHistory

func (t *TCPStats) UpdateHistory()

func (*TCPStats) UpdateRTT

func (t *TCPStats) UpdateRTT(rtt float64)

UpdateRTT updates the sRTT and RTTVAR with a new RTT measurement.

Jump to

Keyboard shortcuts

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