So last night I was playing with a side project and decided to see if I could put some markers onto a Google map based on a tcptraceroute. I am sure that there are numerous other sites that do this for you but it sounded like fun. The other criteria is that I did not want to create a solution based on an existing Ruby gem or other module since there are ones that do google maps integration. What this allows me to do is run a ruby script in the background and update an html page and related Javascript so that I can embed this into any non framework website or even just have it as a straight html and Javascript page but updated at regular intervals as required. Now why update you ask. Well the idea is to plot response times to each major ASN jump in order to help visually identify where latency in a given end point connection appears. So my current version has both the response times and the ASN details or each major jump. Basically a major jump is when the owner details for the ASN change.
So the simple logic is this… Do the tcptraceroute / traceroute and then pass each IP address via the GeoIP databases to see what the ASN details are. As these change I generate the code to create an array of markers which in turn will be used by the html page. My html page to present the map is static but includes the Javascript file that contains the array or marker coordinates.
There are a lot more things to take into account when looking at network response times etc. but for now this was simple enough for my needs.
As a side note of the information is purely an approximate and uses a series of GeoIP databases which I am sure will be out of date in a short period of time, but the end result is basically what I was looking for. And here is the end result.