stats

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package stats summarizes round-trip samples: min, average, max, standard deviation, RFC 3550 jitter, loss and voice quality (MOS).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Jitter

func Jitter(rtts []time.Duration) time.Duration

Jitter is the RFC 3550 interarrival jitter (1/16 gain).

func Loss

func Loss(sent, received int) float64

Loss is the fraction of unanswered samples, clamped to [0, 1].

Types

type Quality

type Quality struct {
	R   float64
	MOS float64
}

Quality is a voice rating: R factor (0 to 100) and MOS (1 to 4.5).

func VoiceQuality

func VoiceQuality(rtt, jitter time.Duration, loss float64) Quality

VoiceQuality applies the simplified ITU-T G.107 E-model. One-way delay is approximated as RTT/2: an indicator, not a measurement.

type Summary

type Summary struct {
	Min, Avg, Max, StdDev time.Duration
	Jitter                time.Duration
}

Summary of the samples of one cycle.

func Summarize

func Summarize(rtts []time.Duration) (Summary, bool)

Summarize computes the summary of the answered samples, in order.

Jump to

Keyboard shortcuts

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