Expand description
§netspeed-cli
A command-line internet bandwidth tester using speedtest.net servers.
§Overview
This crate provides both a library and a binary (netspeed-cli) for
measuring download speed, upload speed, latency, jitter, and latency
under load. It connects to speedtest.net’s server infrastructure to
perform real-world bandwidth tests.
§Modules
bin_errors— Binary-level error handling and exit codescli— Command-line argument parsing with clapcommon— Shared utilities (bandwidth calculation, formatting, validation)config— Configuration management (CLI args + config file)domain— Core business logic (measurement, reporting, server, speedtest)download— Multi-stream download bandwidth measurementendpoints— Canonical speedtest endpoint derivationupload— Multi-stream upload bandwidth measurementerror— Unified error types with categorizationformatter— Output formatting (detailed, simple, JSON, CSV)grades— Quality grade system (A-F ratings)history— Persistent test result historyhttp— HTTP client creation and IP discoveryprofiles— User profiles/roles (gamer, streamer, etc.)progress— Terminal progress bars and spinnersservers— Server discovery, distance calculation, and selectiontask_runner— Test orchestration with template method patterntypes— Shared data structures (Server,TestResult, etc.)
Modules§
- bandwidth_
loop - Shared bandwidth measurement loop for download/upload tests.
- bin_
errors - Binary-level error handling for netspeed-cli.
- cli
- common
- Common shared utilities used across download, upload, formatting, and progress modules.
- config
- domain
- Domain layer for netspeed-cli.
- download
- Multi-stream download bandwidth measurement.
- endpoints
- Speedtest server endpoint derivation.
- error
- formatter
- Output formatting for speed test results.
- grades
- Comprehensive quality grade system (A-F) for all connection metrics.
- history
- http
- http_
client - Abstraction over HTTP client used by phases.
- logging
- Structured logging infrastructure for netspeed-cli.
- orchestrator
- Orchestrates the full speed test lifecycle.
- output
- Output handling trait for extensibility.
- output_
strategy - Output format resolution — extracts format selection from Config into
an
OutputFormatstrategy (Strategy pattern, OCP-compliant). - phase_
registry - Registry for phase functions allowing open/closed extension.
- phase_
runner - Trait to run all test phases. Allows custom implementations for testing.
- phases
- Phase definitions for the speed test lifecycle.
- profiles
- User profiles/roles that customize output based on use case.
- progress
- Terminal progress bars and spinners for test feedback.
- result_
processor - Responsible for grading test results.
- servers
- services
- Service abstractions for dependency injection.
- storage
- Result storage trait for test results.
- task_
runner - Test runner orchestration for download and upload bandwidth tests.
- terminal
- Terminal environment detection and abstraction.
- test_
config - Centralized test configuration constants.
- theme
- Color theme system for terminal output.
- types
- upload
- Multi-stream upload bandwidth measurement.