Hacker News new | past | comments | ask | show | jobs | submit login

Or you can do this in general:

  ping 8.8.8.8 | perl -ne 'BEGIN {$|=1;} s/.*=([0-9\.]+) ms$/\1/ && print'| feedgnuplot --stream --ylabel "Ping time (in ms)" --lines
Advantage: works for ANY input, not just pings. And is infinitely more flexible. Want a histogram of your pings updating in realtime? Here you go:

  ping 8.8.8.8 | perl -ne 'BEGIN {$|=1;} s/.*=([0-9\.]+) ms$/\1/ && print'| feedgnuplot --stream --histo 0 --binwidth 1



But therefore you need perl, gnuplot and feedgnuplot, the latter isn't even available via package manager on my distro.


Another great example how a couple of traditional unix tools (if you want to count perl and gnuplot as traditional unix tools) can replace 250 lines of high-level language code (https://github.com/orf/gping/blob/master/src/main.rs).


Fantastic, thanks, I think this was the final push I needed to start abusing gnuplot.

Though for some reason the plot only updates when I give or take the plot window focus (refreshperiod mentioned in the man page doesn't seem to help, and I think it should default to 1Hz).


Fix for this issue (on wayland) mentioned here: GDK_BACKEND=x11

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=942570




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: