gping: Ping, but with a graph
github.com
github.com
You can run this on your laptop and watch your WiFi drop in and out randomly (as other people around you download stuff, as Bluetooth devices interfere with it, etc.) It's also fun to run a speed test in another tab, and watch the latency increase 10x as needless buffers fill up and your latency-sensitive packets wait in line so your router gets a better review!
If anyone has a detailed guide on using gfblip I'd be really curious to read it.
Check out the instructions in the GitHub repository, has two versions, neither are very long nor complex. https://github.com/apenwarr/blip
After about 2 seconds of blue/green pings that seem faster than should be possible (<10ms), it goes full red.
It does work in Chrome! (Perhaps, Brave is doing some faster-fail on the probe request from the beginning, and then a cached-insta-failure after ~2 seconds?)
My blue pings to calgary are reliably ~2000ms then ~200ms. I wonder where in the chain that pattern is originating. I wonder if it'll stay like that over time.
Chrome also seems to show red dots every ~3 seconds for me, while Firefox shows no red dots, strange.
Tested on Ubuntu.
so browsers behave differently...
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 1Though 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).
(x=time of test, y=hops, z/color=ping time)
Given that "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software." is in the license, and it isn't included... I dunno.
But at the same time, the legal system doesn't work like code. It's more flexible. So, who knows?
For example, we sometimes blindly calculate the mean whereas the data may be such that we end up giving a value the benchmark will never reach.
nping does sound kind of interesting, but meh.
Noticed this uses pinger, which executes the actual ping command behind the scenes and parses the output. Which makes it fragile in case there are changes in the output format of ping. Are there any good alternative libraries that can use raw sockets, etc?
AFAIK, ping is a setuid binary (since it needs raw socket, that is a privileged operation) so a program that implements ping by itself would need to do the same (or it would work for root).
-rwsr-xr-x 1 root root 64424 Jun 28 2019 /bin/ping-rwxr-xr-x 1 root root 76744 Aug 23 15:08 /bin/ping
% getcap /bin/ping
/bin/ping = cap_net_raw+epHow to check:
$ getcap $(which ping)
/usr/bin/ping = cap_net_raw+ep
More about it on [1]https://blog.container-solutions.com/linux-capabilities-in-p...
I assumed you were talking about windows until:
> AFAIK, ping is a setuid binary
Which unfortunately means you’ve partly helped make the GP’s point for them. Under Linux, the command you’re thinking of is ifconfig, which has long been deprecated and doesn’t ship by default anymore in newer distributions.
Times change, tools move on.
This is a great example of one of the failings of the UNIX model. You can’t really parse the ping output across distributions easily, it’s built for humans to consume and until recently didn’t even report timeouts to stdout. Not to mention needing to invoke “ping6” for ipv6, which I need to add support for.
However it’s the best way to do this without needing to run gping and root.
`Error: 'date-time' main.go:59: open C:\Program Files Direct\duck\pings.json: The system cannot find the file specified.`
`not supported by windows. Request timeout for icmp_seq xx`
I reckon a D implementation would be a little bit shorter, I might try and write one tomorrow.