speedtesting

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientName = "client"

NOTE: ClientName is set via build flags https://github.com/m-lab/ndt7-client-go#building-with-a-custom-client-name

Functions

This section is empty.

Types

type Options

type Options struct {
	Insecure bool
	OnDemand bool

	ClientVersion string

	// if set takes precedence over ndt7 locate API as well as the serviceURL
	Server string

	// if set takes precedence over ndt7 locate API
	ServiceURL *url.URL
}

type SpeedTestResult

type SpeedTestResult struct {
	DownloadedBytes float64 `json:"downloadedBytes,omitempty"`
	DownloadMbps    float64 `json:"downloadMbps,omitempty"`
	DownloadRetrans float64 `json:"downloadRetrans,omitempty"`
	DownloadMinRtt  float64 `json:"downloadMinRTT,omitempty"`
	DownloadRTTVar  float64 `json:"downloadRTTVar,omitempty"`

	UploadedBytes float64 `json:"uploadedBytes,omitempty"`
	UploadMbps    float64 `json:"uploadMbps,omitempty"`
	UploadRetrans float64 `json:"uploadRetrans,omitempty"`
	UploadMinRTT  float64 `json:"uploadMinRTT,omitempty"`
	UploadRTTVar  float64 `json:"uploadRTTVar,omitempty"`

	TimeStampStart  int64 `json:"timestampStart,omitempty"`
	TimeStampFinish int64 `json:"timestampFinish,omitempty"`

	Metadata      map[string]string `json:"metadata,omitempty"`
	ClientVersion string            `json:"clientVersion,omitempty"`
	OS            string            `json:"operatingSystem,omitempty"`
	TestServer    string            `json:"testServer,omitempty"`
}

func Run

func Run(ctx context.Context, opts Options) (*SpeedTestResult, error)

func RunSpeedTest

func RunSpeedTest(ctx context.Context, opts *Options) (*SpeedTestResult, error)

RunSpeedTest creates and tests against a new ndt7 client using the clients default locate function.

Jump to

Keyboard shortcuts

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