PingGraph is a terminal based C program that continuously measures and visualizes the network latency (ping) to multiple hosts.
It displays a live bar graph in the console, tracks statistics and supports machine readable exports..
- Pings each host once per interval or just once (
--once). - Parses and extracts the latency from the system
pingcommand. - Visualizes the latency using a color coded ASCII bar.
- Tracks min / max / average latency and timeouts for each host.
- Logs results to a file or exports as JSON/CSV on demand.
- Displays a final summary if requested.
- Interactive or file based host input.
- Live bar graph with latency color codes.
- JSON output (
--json). - CSV export (
--csv).le> - Interval mode (
--interval N) or limited rounds (--limit N). - Summary view (
--summary). - Timeout tracking.
- ANSI color toggle (
--no-color). - Log to file with append support (
--log-append).
- A C compiler (GCC or MSVC).
- POSIX compatible system or Windows.
- System
pingcommand available in PATH.
Compile:
gcc main.c -o pinggraphRun with interactive input:
./pinggraphRun with host file:
./pinggraph --hosts hosts.txt --interval 5 --summaryPrint as JSON:
./pinggraph --once --jsonExport as CSV:
./pinggraph --once --hosts hosts.txt --csv results.csvSimple plain text file, one host per line:
8.8.8.8
cloudflare.com
- Works best in a terminal that supports ANSI colors.
- For consistent results, run with administrator/root privileges.
- To stop the program during live execution, press
Ctrl+C.