spike

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package spike provides a spike detector for NTP responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Detector

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

Detector detects spikes in NTP response samples.

Zero value is ready to use.

func (*Detector) IsSpike

func (d *Detector) IsSpike(sample Sample) bool

IsSpike returns true if the given sample is a spike.

The sample is added to the detector's internal state.

func (*Detector) Jitter

func (d *Detector) Jitter() float64

Jitter returns the current jitter.

type Sample

type Sample struct {
	Offset, RTT float64 // in seconds
}

Sample is a single NTP response sample.

func SampleFromNTPResponse

func SampleFromNTPResponse(resp *ntp.Response) Sample

SampleFromNTPResponse converts an NTP response to a Sample.

Jump to

Keyboard shortcuts

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