jitter

package module
v0.0.0-...-e17f7a2 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 3 Imported by: 0

README

Go Jitter

Report Docs Version

Library to test and calculate network "jitter"

Features

  • ICMP jitter test
  • UDP jitter test
  • Uncorrected Standard Deviation jitter calculation
  • Corrected Standard Deviation jitter calculation (Bessel's Correction)
  • RTT Range

Installation

Get the source with go get:

$ go get github.com/cbergoon/go-jitter

Example Usage

package main

import (
	"fmt"
	"time"

	jitter "github.com/cbergoon/go-jitter"
)

func main() {
	j, err := jitter.NewJitterer("google.com")
	if err != nil {
		fmt.Println(err)
	}

	j.SetBlockSampleSize(10)
	j.SetPingerPrivileged(true)
	j.SetPingerTimeout(time.Second * 10)

	j.Run()

	s := j.Statistics()

	fmt.Println("Squared Deviation: ", s.SquaredDeviation)
	fmt.Println("Uncorrected Deviation: ", s.UncorrectedSD)
	fmt.Println("Corrected Deviation: ", s.CorrectedSD)
	fmt.Println("RTT Range: ", s.RttRange)
	fmt.Println("RTTs: ", s.RTTS)
}

License

This project is licensed under the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JitterStatistics

type JitterStatistics struct {
	Start time.Time
	End   time.Time

	Host string
	RTTS []time.Duration

	UncorrectedSD    time.Duration
	CorrectedSD      time.Duration
	SquaredDeviation time.Duration

	RttRange time.Duration

	PingStatistics *ping.Statistics
}

Statistics represents the jitter test results with corrected and uncorrected deviations

type Jitterer

type Jitterer struct {
	Host string
	// contains filtered or unexported fields
}

Jitterer represents the configuration and actors to test jitter

func NewJitterer

func NewJitterer(targetHost string) (*Jitterer, error)

NewJitterer returns a new Jitterer for the host specified

func (*Jitterer) Run

func (j *Jitterer) Run()

Run executes jitter test

func (*Jitterer) SetBlockSampleSize

func (j *Jitterer) SetBlockSampleSize(size int)

SetBlockSampleSize controls the number of test in the sample

func (*Jitterer) SetPingerPrivileged

func (j *Jitterer) SetPingerPrivileged(value bool)

SetPingerPrivileged indicates if application should use UDP or priveleged ICMP packets

func (*Jitterer) SetPingerTimeout

func (j *Jitterer) SetPingerTimeout(timeout time.Duration)

SetPingerTimeout time for tests to complete

func (*Jitterer) Statistics

func (j *Jitterer) Statistics() *JitterStatistics

Directories

Path Synopsis
cmd
jitter command

Jump to

Keyboard shortcuts

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