SpeedMyNet CLI & Network Monitor
High-precision telemetry tool for bandwidth, bufferbloat, and latency profiling
How measured · Timing precision (±0.4ms) verified against local loopback and Linux tc-netem controlled jitter injection baselines; binary size (6.2 MB) and CLI completion (< 8s) measured on stripped Go builds across macOS and Linux.
Peak download numbers from standard speed tests hide why SSH sessions lag or calls drop during heavy uplinks. SpeedMyNet measures latency under load in a single 6.2 MB Go binary and exports time-series telemetry for Prometheus.
Profiles loaded bufferbloat, packet jitter, and multi-hop stability with ±0.4ms precision in under 8 seconds.
Lightweight 6.2 MB compiled Go CLI and companion WebSocket visualizer streaming microsecond-accurate TCP/UDP socket stages with Prometheus metrics.
Jump to sectionTOC
Problem
Conventional browser speed tests optimize for a single vanity metric—peak download throughput—while ignoring bufferbloat (latency spikes when router queues saturate under concurrent upload/download load). Engineers troubleshooting sluggish SSH sessions, dropped WebRTC audio, or VPN tunnel instability during large git push or container-image uploads needed deterministic, scriptable loaded-latency diagnostics without browser overhead.
Constraints
- Zero Runtime Bloat: Had to ship as a single static binary (
< 10 MB) with zero external runtime dependencies for quick deployment on Linux jump hosts, edge routers, and developer laptops. - Measurement Fidelity: Garbage-collection pauses or UI rendering stalls could not skew sub-millisecond socket round-trip timestamps.
- High-Frequency UI Streaming: The companion live browser dashboard had to ingest up to
2,500packet-telemetry events per second over WebSockets without dropping below60fps.
My Contribution
I designed and implemented the Go probe engine, built the staged unloaded-vs-loaded latency scheduler, added the Prometheus metrics exporter mode, and re-architected the WebSocket dashboard rendering pipeline to eliminate layout thrashing.
Architecture
- Three-Phase Probe Pipeline (Go):
- Baseline Idle Phase: Samples unloaded ICMP/TCP handshake RTT and baseline jitter using monotonic clock timestamps.
- Saturated Load Phase: Opens bounded worker pools to saturate downlink and uplink channels while concurrently running a dedicated latency-probe goroutine on an isolated socket to quantify queue-induced bufferbloat delta.
- Path Stability & Daemon Exporter: Exposes
/metricshistograms (rtt_idle_ms,rtt_loaded_ms,jitter_p99_ms,packet_loss_ratio) for Prometheus and Grafana alerting.
- Decoupled WebSocket Visualizer:
- Ingests raw socket frames into a fixed-size
TypedArraycircular ring buffer and flushes DOM/SVG path updates strictly onrequestAnimationFrameticks rather than per-packet callbacks.
- Ingests raw socket frames into a fixed-size
Verification
- Controlled
tc-netemCalibration: Validated reported RTT and jitter deltas against deterministic Linuxtc qdisc netem delay 25ms 4mstraffic-shaping rules, confirming±0.4msagreement with kernel baselines. - Browser Frame-Budget Profiling: Profiled sustained
2,500 msg/sWebSocket bursts in Chrome DevTools, verifying frame commit times stayed at ~2.1ms(60fps) with zero forced synchronous layouts.
Results
- Fast, Actionable Bufferbloat Isolation: Completes idle + loaded uplink/downlink profiling in under 8 seconds from a 6.2 MB standalone Go binary.
- Sustained Telemetry Observability: Enables continuous ISP and VPN link SLA tracking via native Prometheus scraping without third-party agents.
Evidence
- Engineering Post-Mortem: Taming Real-Time Layout Thrashing in Live Telemetry Dashboards (documents the
48ms -> 2.1msframe-time remediation inside the companion visualizer). - Author Engineering Profile: teddymwai on GitHub
https://tedcraft.dev/works/speed-my-net/