Measuring Web Latency In The Browser

We’ll go out on a limb and assume that anyone reading these words is probably familiar with the classic ping command. Depending on which operating system you worship the options might be slightly different, but every variation of this simple tool does the same thing: send an ICMP echo request and wait for a response. How long it takes to get a response from the target, if it gets one at all, is shown to the user. This if often the very first step to diagnosing network connectivity issues; if this doesn’t work, there’s an excellent chance the line is dead.

But in the modern web-centric view of networking, ping might not give us the whole picture. But nature it doesn’t take into account things like DNS lookups, and it certainly doesn’t help you determine what (if any) services the target has available to you. Accordingly, [Liu Zhiyong] has come up with a tool he calls “pingms”, which allows you to check web server latency right from your browser.

Rather than relying on ICMP, pingms performs a more realistic test. It takes the list of targets from the file “targets.js” and connects to each one over HTTP. How does it work? The code [Liu] has come up with will take each target domain name, append a random number to create a gibberish filename, and then calculate how long it takes to get a response when trying to download the file. Obviously it’s going to be getting a 404 response from the web server, but the important thing is simply that it gets the response.

With this data, [Liu] has come up with a simplistic but very slick interface which shows the user the collected data with easy to understand color-coded graphs. As interesting as it is to see how long it takes your favorite web sites or service providers to wake up and start talking, watching the colored bars hop up and down the list to sort themselves is easily our favorite part of pingms.

[Liu] has released pingms under the GPLv3 license, so if you’re looking to utilize the software for your own purposes you just need to provide a list of test targets. If you need to perform low-level diagnostics, check out this handy network tester you can build for cheap.

8 thoughts on “Measuring Web Latency In The Browser

  1. Been done before but very nice and as you say available via command line. I dont know about others here but what really frigs with your web experience is not the site it’s self but the dozens of adverts each loads to support it’s self. If they are waiting to load because the advert site is busy then you just have to wait. It’s not so obvious how to measure all that but it would in many cases be a more useful measure of time /performance of the site you were checking and maybe a chance that it would lead to faster ‘vert delivery (Short of using a filter of course!!).

      1. Like Bitcoin mining in the browser? I think I’ll take some ads over any more slowdown on the web…

        Unless you meant just directly paying the content creators, but I’d rather pay with something with lower transaction fees, like regular money. The Patreon model seems to work for some creators.

        All the content on social media is created by users who aren’t expecting to directly profit, so if the tech itself is decentralized it shouldn’t need to cost anything, except maybe the price of a domain name.

  2. There was a time when people on IRC all did a ping on a person they wanted to tease and he/she would time out as their internet would be flooded. The interesting thing about that is that it was a social effort since it would only work when enough people joined in.

    Now of course we just get people fired and kicked out of their youtube accounts and home, and arrested, and swatted.

Leave a Reply to Michael MatherCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.