#speed-test #cloudflare

bin+lib cfspeedtest

Unofficial CLI for speed.cloudflare.com

16 stable releases

1.3.0 Dec 2, 2024
1.2.6 Aug 29, 2024
1.2.5 Jul 16, 2024
1.2.3 Mar 20, 2024
0.1.10 Mar 17, 2023

#381 in Command line utilities

Download history 151/week @ 2024-08-26 9/week @ 2024-09-02 5/week @ 2024-09-09 12/week @ 2024-09-16 24/week @ 2024-09-23 14/week @ 2024-09-30 9/week @ 2024-10-07 21/week @ 2024-10-14 28/week @ 2024-11-04 2/week @ 2024-11-18 8/week @ 2024-11-25 176/week @ 2024-12-02

187 downloads per month

MIT license

27KB
603 lines

cfspeedtest - Unofficial CLI for speed.cloudflare.com

CI Release Crates.io Version Crates.io Downloads

Installation

Install using cargo:

cargo install cfspeedtest

Or download the latest binary release here: cfspeedtest/releases/latest

Alternatively there is also a docker image available on dockerhub

docker run cybuerg/cfspeedtest

Usage

> cfspeedtest --help
Unofficial CLI for speed.cloudflare.com

Usage: cfspeedtest [OPTIONS]

Options:
  -n, --nr-tests <NR_TESTS>
          Number of test runs per payload size. Needs to be at least 4 [default: 10]
      --nr-latency-tests <NR_LATENCY_TESTS>
          Number of latency tests to run [default: 25]
  -m, --max-payload-size <MAX_PAYLOAD_SIZE>
          The max payload size in bytes to use [100k, 1m, 10m, 25m or 100m] [default: 25MB]
  -o, --output-format <OUTPUT_FORMAT>
          Set the output format [csv, json or json-pretty] > This silences all other output to stdout [default: StdOut]
  -v, --verbose
          Enable verbose output i.e. print boxplots of the measurements
      --ipv4
          Force usage of IPv4
      --ipv6
          Force usage of IPv6
  -d, --disable-dynamic-max-payload-size
          Disables dynamically skipping tests with larger payload sizes if the tests for the previous payload size took longer than 5 seconds
      --download-only
          Test download speed only
      --upload-only
          Test upload speed only
  -h, --help
          Print help
  -V, --version
          Print version

Example usage:
asciicast

Example with json-pretty output:
asciicast

Development

Logging

Set the log level using the RUST_LOG env var:

RUST_LOG=debug cargo run

Release

Using cargo-release

Install cargo-release:

cargo install cargo-release

Create the release (version bump levels are [patch, minor, major]):

cargo release patch --execute

This will bump the cfspeedtest version in both Cargo.toml and Cargo.lock and run cargo publish to push the release on crates.io. Additionally a version git tag is created and pushed to master triggering the GH action that creates the binary releases.

On GitHub

Release builds are published automatically using github actions. They are triggered when a git tag in the format v[0-9]+.* is pushed.

git tag v1.0.0
git push origin v1.0.0

On crates.io

  1. Update cfspeedtest version in Cargo.toml
  2. cargo publish --dry-run
  3. Verify contents using cargo package --list
  4. Upload to crates.io cargo publish

Dependencies

~9–21MB
~291K SLoC