ndt7

package
v0.4.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package ndt7 contains a non-backwards compatible redesign of the NDT network performance measurement protocol. The complete specification of the protocol is available at https://github.com/m-lab/ndt-cloud/blob/master/spec/ndt7.md.

Index

Constants

View Source
const DownloadURLPath = "/ndt/v7/download"

DownloadURLPath selects the download subtest.

View Source
const MinMaxMessageSize = 1 << 17

MinMaxMessageSize is the minimum value of the maximum message size that an implementation MAY want to configure. Messages smaller than this threshold MUST always be accepted by an implementation.

View Source
const MinMeasurementInterval = 250 * time.Millisecond

MinMeasurementInterval is the minimum value of the interval betwen two consecutive measurements performed by either party. An implementation MAY choose to close the connection if it is receiving too frequent Measurement messages from the other endpoint.

View Source
const SecWebSocketProtocol = "net.measurementlab.ndt.v7"

SecWebSocketProtocol is the WebSocket subprotocol used by ndt7.

View Source
const UploadURLPath = "/ndt/v7/upload"

UploadURLPath selects the upload subtest.

Variables

This section is empty.

Functions

This section is empty.

Types

type BBRInfo

type BBRInfo struct {
	// Bandwidth is the bandwidth measured by BBR in bits per second.
	Bandwidth float64 `json:"bandwidth"`

	// RTT is the RTT measured by BBR in milliseconds.
	RTT float64 `json:"rtt"`
}

The BBRInfo struct contains information measured using BBR.

type Client

type Client struct {
	Dialer websocket.Dialer
	URL    url.URL
}

Client is a simplified ndt7 client.

func (Client) Download

func (cl Client) Download() error

Download runs a ndt7 download test.

type DownloadHandler

type DownloadHandler struct {
	Upgrader websocket.Upgrader
}

DownloadHandler handles a download subtest from the server side.

func (DownloadHandler) ServeHTTP

func (dl DownloadHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request)

Handle handles the download subtest.

type Measurement

type Measurement struct {
	// Elapsed is the number of seconds elapsed since the beginning.
	Elapsed float64 `json:"elapsed"`

	// NumBytes is the number of bytes transferred since the beginning.
	NumBytes float64 `json:"num_bytes"`

	// BBRInfo is the data measured using TCP BBR instrumentation.
	BBRInfo *BBRInfo `json:"bbr_info,omitempty"`
}

The Measurement struct contains measurement results. This structure is meant to be serialised as JSON as sent on a textual message.

Jump to

Keyboard shortcuts

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