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 ¶
RunMonitor is the real Bandwidth Monitor engine for Linux. It generates no traffic: it reads the kernel's per-interface byte counters from /sys/class/net/<iface>/statistics/{rx,tx}_bytes and derives the actual download / upload throughput of the whole PC from byte deltas between samples. It runs until ctx is cancelled.
Scope: every "up" interface except loopback (lo) is summed, so the numbers reflect total PC throughput (Wi-Fi, Ethernet, VPN, LAN, ...).
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.