Movatterモバイル変換


[0]ホーム

URL:


speedtest

package
v1.92.2Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License:BSD-3-ClauseImports:7Imported by:14

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package speedtest contains both server and client code forrunning speedtests between tailscale nodes.

Index

Constants

View Source
const (MinDuration     = 5 *time.Second// minimum duration for a testDefaultDuration =MinDuration// default duration for a testMaxDuration     = 30 *time.Second// maximum duration for a testDefaultPort = 20333)

Variables

This section is empty.

Functions

funcServe

func Serve(lnnet.Listener)error

Serve starts up the server on a given host and port pair. It starts to listen forconnections and handles each one in a goroutine. Because it runs in an infinite loop,this function only returns if any of the speedtests return with errors, or if thelistener is closed.

Types

typeDirection

type Directionint
const (DownloadDirection =iotaUpload)

func (*Direction)Reverse

func (d *Direction) Reverse()

func (Direction)String

func (dDirection) String()string

typeResult

type Result struct {Bytesint// number of bytes sent/received during the intervalIntervalStarttime.Time// start of the intervalIntervalEndtime.Time// end of the intervalTotalbool// if true, this result struct represents the entire test, rather than a segment of the test}

This represents the Result of a speedtest within a specific interval

funcRunClient

func RunClient(directionDirection, durationtime.Duration, hoststring) ([]Result,error)

RunClient dials the given address and starts a speedtest.It returns any errors that come up in the tests.If there are no errors in the test, it returns a slice of results.

func (Result)Interval

func (rResult) Interval()time.Duration

func (Result)MBitsPerSecond

func (rResult) MBitsPerSecond()float64

func (Result)MegaBits

func (rResult) MegaBits()float64

func (Result)MegaBytes

func (rResult) MegaBytes()float64

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp