| Crates.io | rollping |
| lib.rs | rollping |
| version | 0.1.2 |
| created_at | 2025-11-17 22:26:14.309713+00 |
| updated_at | 2025-11-17 23:55:50.061817+00 |
| description | A ping time statistics aggregator. |
| homepage | https://github.com/wbbradley/rollping |
| repository | https://github.com/wbbradley/rollping |
| max_upload_size | |
| id | 1937618 |
| size | 79,700 |
A fast, concurrent ping statistics aggregator with built-in geolocation support.
rollping reads a list of hosts from stdin, pings them concurrently, and outputs aggregated statistics as single-line JSON. Perfect for monitoring network latency across multiple hosts and integrating with other command-line tools.
-g flag)-v for warnings, -vv for info, or RUST_LOG environment variablecargo install --locked rollping
git clone https://github.com/wbbradley/rollping
cd rollping
cargo install --path .
echo -e "8.8.8.8\n1.1.1.1\n1.0.0.1" | rollping
Output is JSON only with no log messages.
# Show warnings (-v)
echo -e "8.8.8.8\n1.1.1.1" | rollping -v
# Show info messages (-vv)
echo -e "8.8.8.8\n1.1.1.1" | rollping -vv
# Include location data in output
echo -e "8.8.8.8\n1.1.1.1" | rollping -g
# With geolocation and verbose logging
echo -e "8.8.8.8\n1.1.1.1" | rollping -g -vv
# Send 5 pings to each host with 1 second timeout
echo -e "8.8.8.8\n1.1.1.1" | rollping -c 5 -t 1.0
cat hosts.txt | rollping -c 3
echo -e "8.8.8.8\n1.1.1.1" | rollping | jq .
The output is a single-line JSON object with the following fields:
{
"timestamp": 1763421627,
"avg_microsecs": 4235,
"median_microsecs": 4567,
"p95_microsecs": 5123,
"p99_microsecs": 5234,
"max_microsecs": 5345,
"non_responsive_nodes": 0,
"total_hosts": 2,
"pings_per_host": 3,
"timeout_secs": 2.0
}
Field descriptions:
timestamp: Unix epoch timestamp (seconds) when the measurement was taken*_microsecs fields: All latency values in microseconds, rounded to the nearest integerNote: The location field is only included when using the -g/--geo flag:
{
...
"location": {
"country": "United States",
"country_code": "US",
"city": "Denver",
"latitude": 39.8661,
"longitude": -104.9197
}
}
Options:
-c, --count <COUNT>
Number of pings to send to each host [default: 3]
-t, --timeout-secs <TIMEOUT_SECS>
Timeout in seconds for each ping [default: 2.0]
-v, --verbose
Increase logging verbosity (-v for WARN, -vv for INFO)
-g, --geo
Enable geolocation (fetches and includes location data)
-h, --help
Print help
-V, --version
Print version
By default, rollping only shows errors. Use the -v flag for more verbosity:
# Silent mode - only errors and JSON output (default)
rollping < hosts.txt
# Show warnings (-v)
rollping -v < hosts.txt
# Show info messages (-vv)
rollping -vv < hosts.txt
You can also use the RUST_LOG environment variable to override the log level:
# Show debug logs
RUST_LOG=debug rollping < hosts.txt
# Show only errors (same as default)
RUST_LOG=error rollping < hosts.txt
Geolocation is opt-in and disabled by default. Use the -g/--geo flag to enable it:
rollping -g < hosts.txt
When enabled, rollping downloads the MaxMind GeoLite2-City database (~60MB) on first run and caches it in /tmp/rollping/. This enables geolocation of your current machine's public IP address.
The database is:
/tmp/rollping/GeoLite2-City.mmdbIf geolocation fails or is unavailable, the tool continues normally without the location field in the output.
Monitor a list of critical servers and log results:
cat production-hosts.txt | rollping >> latency-log.jsonl
Add to crontab for periodic monitoring:
*/5 * * * * cat /path/to/hosts.txt | rollping >> /var/www/html/latency.jsonl
# Send to monitoring endpoint
cat hosts.txt | rollping | \
curl -X POST -H "Content-Type: application/json" \
-d @- https://monitoring.example.com/metrics
# Track your location along with latency data
cat hosts.txt | rollping -g >> latency-log.jsonl
# Check common DNS servers (output in microseconds)
echo -e "8.8.8.8\n8.8.4.4\n1.1.1.1\n1.0.0.1" | rollping | jq .avg_microsecs
Note: On Linux and macOS, you may need elevated privileges to send ICMP packets. Run with sudo if you encounter permission errors.
rollping is designed for efficiency:
Typical performance: ~100ms overhead for pinging 10 hosts with 3 pings each.
MIT
Contributions welcome! Please feel free to submit a Pull Request.