Expand description
Ping, jitter, download, and upload speeds
This block uses Cloudflare’s networkquality-rs (nq) library to run a speedtest and report the ping, jitter, download speed, and upload speed.
The block can be configured to use custom endpoints for the speedtest, but by default Cloudflare’s nq endpoints are used.
For example setting config_url to "https://mensura.cdn-apple.com/.well-known/nq" will use Apple’s nq endpoints instead of Cloudflare’s.
nq is based on the IETF draft: “Responsiveness under Working Conditions”.
The draft defines “responsiveness”, measured in Round trips Per Minute (RPM), as a useful measurement of network quality.
§Configuration
| Key | Values | Default |
|---|---|---|
format | A string to customise the output of this block. See below for available placeholders. | " ^icon_ping $ping.eng(prefix:m) ^icon_net_down $speed_down ^icon_net_up $speed_up " |
interval | Update interval in seconds | 1800 |
config_url | The endpoint to get the responsiveness config from. See SpeedtestConfig::config_url for the expected format of the configuration JSON returned by this endpoint. | None |
large_download_url | The large file endpoint which should be multiple GBs. | "https://h3.speed.cloudflare.com/__down?bytes=10000000000" |
small_download_url | The small file endpoint which should be very small, only a few bytes. | "https://h3.speed.cloudflare.com/__down?bytes=10" |
upload_url | The upload url which accepts an arbitrary amount of data. | "https://h3.speed.cloudflare.com/__up" |
latency | Arguments for the latency test. | See table below |
rpm | Arguments for the RPM test. | See table below |
§Latency Configuration (settings used for ping and jitter)
| Key | Values | Default |
|---|---|---|
runs | The number of latency test runs to perform. | 20 |
§RPM Configuration (settings used for speed_down and speed_up)
| Key | Values | Default |
|---|---|---|
moving_average_distance | The number of intervals to use when calculating the moving average. | 4 |
std_tolerance | How far a measurement is allowed to be from the previous moving average before the measurement is considered unstable. | 0.05 |
trimmed_mean_percent | Determines which percentile to use for averaging when calculating the trimmed mean of throughputs or RPM scores. A value of 0.95 means to only use values in the 95th percentile to calculate an average. | 0.95 |
max_loaded_connections | The maximum number of loaded connections that the test can use to saturate the network. | 16 |
interval_duration_ms | The duration between test intervals in milliseconds (ms). | 500 (0.5 seconds) |
test_duration_ms | The overall test duration in milliseconds (ms). | 12_000 (12 seconds) |
conn_type | The type of connection to use for the speed test. One of "h1", "h2", or "h3" | "h2" |
upload_bytes_per_request | The number of bytes to upload per request during the speed test. | 100_000_000 |
§Available Format Keys
| Placeholder | Value | Type | Unit |
|---|---|---|---|
ping | Ping delay | Number | Seconds |
jitter | Jitter | Number | Seconds |
speed_down | Download speed | Number | Bits per second |
speed_up | Upload speed | Number | Bits per second |
§Examples
Show only ping (with an icon)
[[block]]
block = "speedtest"
format = " ^icon_ping $ping "Hide ping and display speed in bytes per second each using 4 characters (without icons)
[[block]]
block = "speedtest"
format = " $speed_down.eng(w:4,u:B) $speed_up(w:4,u:B) "Advanced configuration
[[block]]
block = "speedtest"
[block.latency]
runs = 5
[block.rpm]
conn_type = "h1"§Icons Used
ping(^icon_ping)net_down(^icon_net_down)net_up(^icon_net_up)