pong

September 6, 2007 Alex Chaffee

Oscillosocope Pong

ping is awesome, but it’s a little simple-minded. I often find myself running several pings at a time, especially when debugging network configurations. And when you’re watching ping run in several windows, as routers go up and down and packets spurt and congeal like blood in a trauma center, extra features spring naturally to mind…

Enter pong. It’s a Ruby app I wrote that runs ping in the background and decorates the results, tracking statistics in realtime, refreshing the screen every 5 seconds. Here, I’ll show you:

% pong localhost 192.168.1.240 192.168.1.1 google.com yahoo.com pivotalblabs.com

Last 10 seconds:
Mean            Missing         Host
   0.073 msec      0 (0.00%)    localhost (127.0.0.1)
   2.884 msec      0 (0.00%)    192.168.1.240 (192.168.1.240)
  25.745 msec      0 (0.00%)    192.168.1.1 (192.168.1.1)
  98.905 msec      0 (0.00%)    google.com (72.14.207.99)
  38.761 msec      0 (0.00%)    yahoo.com (66.94.234.13)
 113.418 msec      0 (0.00%)    pivotalblabs.com (72.9.100.34)

Last 60 seconds:
Mean            Missing         Host
   0.092 msec      0 (0.00%)    localhost (127.0.0.1)
   5.757 msec      0 (0.00%)    192.168.1.240 (192.168.1.240)
  24.198 msec      0 (0.00%)    192.168.1.1 (192.168.1.1)
  98.840 msec      1 (1.67%)    google.com (72.14.207.99)
  38.504 msec      0 (0.00%)    yahoo.com (66.94.234.13)
 110.687 msec      0 (0.00%)    pivotalblabs.com (72.9.100.34)

Entire run (97 sec):
Mean            Missing         Host
   0.088 msec      0 (0.00%)    localhost (127.0.0.1)
   5.716 msec      0 (0.00%)    192.168.1.240 (192.168.1.240)
  23.713 msec      1 (1.03%)    192.168.1.1 (192.168.1.1)
  99.261 msec      1 (1.03%)    google.com (72.14.207.99)
  35.403 msec      0 (0.00%)    yahoo.com (66.94.234.13)
 105.349 msec      4 (4.12%)    pivotalblabs.com (72.9.100.34)

I’ve packaged it up as a gem and put the source on RubyForge. Install it with

sudo gem install pong

and let me know what you think. Bug reports, feature requests, and (naturally) patches welcome. Currently it’s only been tested on OS X and might work on other Unixes.

(Image of Edmond Lau’s two-player analog oscilloscope Pong.)

About the Author

Biography

Previous
Ruby quiz du jour answer
Ruby quiz du jour answer

Josh got it right. 1.0/0 indeed resolves to "Infinity". Pretty cool! -Felix

Next
Ruby quiz du jour
Ruby quiz du jour

Question: In Ruby, what does the following represent? -1.0/0...0 Post your guesses as comments. Answer t...