Skip to content

Lethusang/netmeter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

NetMeter

NetMeter is a lightweight command-line tool written in Go for measuring internet connection speed. It tests download speed, upload speed, and ping latency using HTTP requests.

Features

  • Measures download speed using configurable file sizes
  • Measures upload speed with customizable test durations
  • Measures ping latency using HTTP HEAD requests
  • Supports concurrent or sequential testing
  • Can run in detached mode (background)
  • Provides detailed progress reporting with verbose mode
  • Customizable timeouts and test URLs

Installation

To install NetMeter, you need to have Go installed on your system.

go install github.com/Lethusang/netmeter@latest

Alternatively, you can clone the repository and build the binary manually:

git clone https://github.com/Lethusang/netmeter.git
cd netmeter
go build

Usage

Basic usage:

netmeter

This will run a speed test using the default settings.

Command Line Options

  -concurrent
        Run tests concurrently
  -detach
        Run in background (detached mode)
  -download-url string
        URL to download test file from (default "https://speed.cloudflare.com/__down?bytes=100000000")
  -max-download int
        Maximum bytes to download (0 for unlimited) (default 104857600)
  -output string
        File to write results to (default: netmeter_results.txt in detached mode)
  -timeout duration
        HTTP client timeout (default 1m0s)
  -upload-size int
        Size in bytes for upload test (default 10485760)
  -upload-url string
        URL to upload test data to (default "https://speed.cloudflare.com/__up")
  -verbose
        Show detailed progress

Examples

Run a basic speed test:

netmeter

Run with verbose output:

netmeter -verbose

Run tests concurrently:

netmeter -concurrent

Run in detached mode and save results to a specific file:

netmeter -detach -output=results.txt

Customize test URLs and sizes:

netmeter -download-url="https://example.com/speedtest/download" -upload-url="https://example.com/speedtest/upload" -upload-size=5242880

Set a custom timeout:

netmeter -timeout=30s

Limit download size:

netmeter -max-download=50000000

How It Works

NetMeter tests your internet connection in three ways:

  1. Ping Test: Sends multiple HTTP HEAD requests to measure latency.
  2. Download Test: Downloads data from a specified URL and measures speed.
  3. Upload Test: Uploads data to a specified URL for a fixed duration and measures speed.

By default, NetMeter uses Cloudflare's speed test endpoints, but you can specify custom endpoints if needed.

Default Test Parameters

  • Download test: 100MB file from Cloudflare
  • Upload test: 10MB of data for 5 seconds
  • Ping test: Average of 5 measurements
  • HTTP client timeout: 60 seconds

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages