Windows:
- Download Crystal from the official installer: https://crystal-lang.org/install
- Install and ensure the installer adds Crystal to PATH.
Linux (Debian/Ubuntu):
curl -fsSL https://crystal-lang.org/install.sh | sudo bash
sudo apt install crystal
macOS:
brew install crystal
- Navigate to the folder:
cd pinggraph
- Run directly without building:
crystal run src/pinggraph.cr -- --host google.com --interval 1
- Or build a fast executable:
crystal build src/pinggraph.cr --release
Executable will be created in the same folder.
PingGraph is a minimal command-line latency visualizer written in Crystal. It pings a target host at a fixed interval and renders the latency as a clean ASCII bar graph.
34ms ||||||
52ms ||||||||||||||
108ms |||||||||||||||||||||||||||
timeout
44ms |||||||||
- Cross-platform: Windows, Linux, macOS
- Automatic ping output parsing
- ASCII bar scaling based on latency
- Adjustable interval
- Optional fixed duration
- Optional single-ping mode
pinggraph [options]
--host HOST Host to ping (default: google.com)
--interval SECONDS Seconds between pings (default: 1)
--duration SECONDS Total runtime
--once Run a single ping and exit
Ping Google every second:
pinggraph --host google.com --interval 1
Run for 30 seconds:
pinggraph --duration 30
Single ping:
pinggraph --once