Documentation
¶
Index ¶
Constants ¶
const ( // DefaultConnections is the number of parallel streams used to saturate the link. DefaultConnections = 5 // DefaultDuration is how long each transfer phase (download / upload) runs. DefaultDuration = 10 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func BytesPerSecToMbps ¶
BytesPerSecToMbps converts a raw byte/sec rate into megabits per second.
func Run ¶
Run executes the full test: discover targets, download, upload, latency. It streams Phase transitions on p.Phases, Samples on p.Samples, and a final Result on p.Result. Always emits a Result (best-effort partials on cancel).
func RunMonitor ¶ added in v1.3.1
RunMonitor is the real Bandwidth Monitor engine for macOS. It generates no traffic: it reads OS interface byte counters via `netstat -ib -n` and derives the actual download / upload throughput of the whole machine from deltas between samples. It runs until ctx is cancelled.
Scope: every non-loopback interface reported by netstat is summed (en0, en1, utun* for VPNs, etc.), matching the spirit of Linux and Windows implementations.
Types ¶
type Progress ¶
type Progress struct {
URLs []string // discovered target URLs (set once)
ServerName string // human-readable server/region label (set once)
Phases chan Phase // phase transitions
Samples chan Sample
Result chan Result
Err error
}
Progress is the live channel payload the UI consumes.