Skip to content

Network speed tester including server discovery, latency measurement, download and upload speed testing.

License

Notifications You must be signed in to change notification settings

FrankRay78/NetPace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

64 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetPace

NuGet Build & Tests

Network speed tester including server discovery, latency measurement, download and upload speed testing.

Built with .NET 8.0 — runs on Windows, Linux, and macOS.

Report Bug - Request Feature


About The Project

A cross-platform command-line application for performing network speed tests, including server discovery, latency measurement, download and upload speed testing. The core speed test library, NetPace.Core, has been designed for developer use and can be installed via NuGet.

NetPace is not endorsed by or related to Speedtest by Ookla in any way, although their servers are used under the hood in the OoklaSpeedtest implementation (the default speed test provider for NetPace).

The obligatory screenshot (as of 12 April 2025):

NetPace screenshot - 12 April 2025


Background

The idea for this project came from my experience as the Spectre.Console CLI sub-system maintainer, never having actually used the library for my own use. My motivation is to become expert at developing excellent command line applications, following best practices like the Command Line Interface Guidelines, and then taking the experience back into my maintainer role.

This is also known as 'dogfooding' in the tech industry ie. using your own product before expecting others to do the same.


Getting Started

Developed with Microsoft .NET 8.0 on Windows 10 using Visual Studio 2022 Community. Other modern environments should work fine.

Then clone this repository locally and build.


Usage

NetPace --help will display detailed usage instructions.

C:\>NetPace.exe --help

    _   __         __     ____
   / | / /  ___   / /_   / __ \  ____ _  _____  ___
  /  |/ /  / _ \ / __/  / /_/ / / __ `/ / ___/ / _ \
 / /|  /  /  __// /_   / ____/ / /_/ / / /__  /  __/
/_/ |_/   \___/ \__/  /_/      \__,_/  \___/  \___/


DESCRIPTION:
Network speed tester including server discovery, latency measurement, download and upload speed testing.

USAGE:
    NetPace [OPTIONS] [COMMAND]

OPTIONS:
                           DEFAULT
    -h, --help                              Prints help information.
        --csv                               Display minimal output in CSV format (always includes timestamp).
        --csv-delimiter    ,                Single character delimiter to use in CSV output.
        --no-download                       Do not perform download test.
        --no-upload                         Do not perform upload test.
    -t, --timestamp                         Include a timestamp.
    -u, --unit             BitsPerSecond    The speed unit. <BitsPerSecond, BytesPerSecond>
        --unit-system      SI               The speed unit system. <SI, IEC>
                                            SI steps up in powers of 1000 (KB, MB, GB), common in networking, while IEC
                                            uses powers of 1024 (KiB, MiB, GiB), standard in computing and storage.
        --verbosity        Normal           The verbosity level. <Minimal, Normal, Debug>
                                            Minimal is ideal for batch scripts and redirected output.

COMMANDS:
    servers    Show the nearest speed test servers.

Developer Use

Want to integrate network speed testing into your own app?

Install the core library via NuGet:

dotnet add package NetPace.Core

Then use the ISpeedTestService interface:

using NetPace.Core;
using NetPace.Core.Clients.Ookla;

var speedTester = new OoklaSpeedtest() as ISpeedTestService;

var servers = await speedTester.GetServersAsync();
var fastest = await speedTester.GetFastestServerByLatencyAsync(servers);

var downloadResult = await speedTester.GetDownloadSpeedAsync(fastest.Server);
var uploadResult = await speedTester.GetUploadSpeedAsync(fastest.Server);

Console.WriteLine($"{fastest.Server.Sponsor} ({fastest.Latency} ms)");
Console.WriteLine($"Download: {downloadResult.GetSpeedString(SpeedUnit.BitsPerSecond, SpeedUnitSystem.SI)}");
Console.WriteLine($"Upload: {uploadResult.GetSpeedString(SpeedUnit.BitsPerSecond, SpeedUnitSystem.SI)}");

See the full usage example.


Roadmap

  • Download speed test
  • Upload speed test
  • User-configurable switches
    • BitsPerSecond or BytesPerSecond
    • SI or IEC
    • Fixed speed unit (eg. Mbps, Gbps)
    • Verbosity of output
    • --plain switch for minimal output (nb. implemented by '--verbosity=Minimal')
    • CSV output
    • Maximum speed test (time)
    • Maximum speed test (size transferred)
  • Periodically repeat tests
  • Run unit tests on PR
  • NuGet package for the core library

See the open issues for a full list of proposed features (and known issues).


Contributing

Important

I'm not currently accepting pull requests for this project.

You can contribute by opening a new issue or commenting on existing issues, and you are most welcome to fork the repository for your own purposes.

But please don't be offended if I close or delete issues as I see fit.


License

Distributed under the MIT license. See LICENSE for more information.


Contact

Frank Ray - LinkedIn - Better Software UK

GitHub: https://github.com/FrankRay78/NetPace