package speedtest
import "tailscale.com/net/speedtest"
Package speedtest contains both server and client code for running speedtests between tailscale nodes.
Index ¶
Constants ¶
const ( MinDuration = 5 * time.Second // minimum duration for a test DefaultDuration = MinDuration // default duration for a test MaxDuration = 30 * time.Second // maximum duration for a test DefaultPort = 20333 )
Functions ¶
func Serve ¶
Serve starts up the server on a given host and port pair. It starts to listen for connections 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 the listener is closed.
Types ¶
type Direction ¶
type Direction int
func (*Direction) Reverse ¶
func (d *Direction) Reverse()
func (Direction) String ¶
type Result ¶
type Result struct { Bytes int // number of bytes sent/received during the interval IntervalStart time.Time // start of the interval IntervalEnd time.Time // end of the interval Total bool // 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
func RunClient ¶
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 (Result) MBitsPerSecond ¶
func (Result) MegaBits ¶
func (Result) MegaBytes ¶
Source Files ¶
speedtest.go speedtest_client.go speedtest_server.go
- Version
- v1.84.1 (latest)
- Published
- May 29, 2025
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 56 minutes ago –
Tools for package owners.