Skip to content

laventura/fast-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fast-rs

A high-performance command-line tool written in Rust for measuring internet download and upload speeds using fast.com (Netflix's speed test service).

Features

  • Fast & Efficient: 5-10x faster execution compared to Node.js alternatives
  • Comprehensive Testing: Download and upload speed measurement
  • Network Metrics: Latency, jitter, and buffer bloat assessment
  • Location Detection: Automatic IP and geographic location identification
  • Multiple Samples: Run multiple tests for improved accuracy
  • Multiple Output Formats: Standard, JSON, CSV, and single-line formats
  • Progress Indicators: Animated spinners during testing
  • Cross-Platform: Works on Linux, macOS, and Windows

Installation

From Source

git clone https://github.com/your-username/fast-rs.git
cd fast-rs
cargo build --release

The binary will be available at target/release/fast-rs.

Using Cargo

cargo install --path .

Usage

Basic Speed Test

# Download speed only
fast-rs

# Download and upload speeds
fast-rs --upload

Multiple Samples for Better Accuracy

# Run 3 download tests and return the best result
fast-rs --samples 3

# Run 5 tests with upload
fast-rs --upload --samples 5

Output Formats

# JSON format
fast-rs --json

# CSV format (great for logging)
fast-rs --csv

# Single line format
fast-rs --single-line

# Quiet mode (results only)
fast-rs --quiet

Advanced Options

# Verbose output with detailed information
fast-rs --verbose

# Custom timeout
fast-rs --timeout 60

# Different units
fast-rs --units kbps
fast-rs --units gbps

# Disable colored output
fast-rs --no-color

Output Examples

Standard Format

fast-rs v0.1.0
Testing download speed...

⬇ 245.3 Mbps
⬆ 38.7 Mbps

Verbose Format

fast-rs v0.1.0
Configuration:
  Timeout: 30s
  Samples: 3
  Upload test: true
  Output format: Standard

Initializing fast.com connection...
✓ Connected to fast.com
Detecting location and IP...
✓ Location: Mountain View, California, United States (IP: XX.YY.ZZ.DD)
Testing download speed...
Test destination: https://destination.host.example.com/speedtest...
✓ Download test completed: 274.7 Mbps (best of 3 samples)
✓ Network metrics: latency 12ms, jitter 0.9ms, buffer bloat 0ms
✓ Upload test completed: 40.8 Mbps (best of 3 samples)

⬇ 274.7 Mbps
⬆ 40.8 Mbps

JSON Format

{
  "download_speed": 245.3,
  "upload_speed": 38.7,
  "download_unit": "Mbps",
  "upload_unit": "Mbps",
  "latency": 12,
  "buffer_bloat": 7,
  "jitter": 1.02,
  "user_location": "Mountain View, California, United States",
  "user_ip": "XX.YY.ZZ.DD",
  "timestamp": "2025-09-11T00:57:12Z",
  "test_duration": 0.77,
  "server": "fast.com"
}

CSV Format

timestamp,download_speed,upload_speed,unit,latency,buffer_bloat,jitter,location,ip
2025-09-11T01:00:46Z,239.6,38.2,Mbps,10,0,2.6,Mountain View, California, United States,XX.YY.ZZ.DD

Network Metrics Explained

  • Latency: Round-trip time for packets (lower is better)
  • Jitter: Variation in latency measurements (lower is better)
  • Buffer Bloat: Additional latency under network load (lower is better)

Command Line Options

Option Short Description
--upload -u Test upload speed in addition to download
--json Output results in JSON format
--single-line Output results in single line format
--csv Output results in CSV format
--verbose -v Show detailed progress and debug information
--quiet Suppress progress indicators
--no-color Disable colored output
--timeout Timeout in seconds (default: 30)
--samples Number of test iterations (default: 1)
--units Force output units: bps, kbps, mbps, gbps
--help -h Display usage information
--version -V Show version number

Performance

  • Cold start: < 500ms from command execution to first measurement
  • Memory usage: < 10MB peak memory consumption
  • Binary size: < 5MB compiled binary
  • Accuracy: ±5% deviation from fast.com web results

Requirements

  • Internet connection
  • Rust 1.70+ (for building from source)

How It Works

fast-rs uses the same infrastructure as fast.com (Netflix's CDN) to measure internet speeds:

  1. Discovery: Extracts test URLs from fast.com's JavaScript
  2. Download Test: Downloads data from Netflix CDN servers
  3. Upload Test: Uploads data to measure upload speeds (when supported)
  4. Metrics Collection: Measures latency, jitter, and buffer bloat
  5. Location Detection: Identifies user's IP and geographic location

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Netflix for providing the fast.com infrastructure
  • The Rust community for excellent networking libraries
  • Fast CLI projects that inspired this implementation

About

Rust-based, high-perf CLI to measure internet download/upload speeds using Fast.com

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages