Measuring Performance with Boomerang

2010-06-30 00:00:00 +0100 by Alex R. Young

Boomerang by the Exceptional Performance team at Yahoo! is a way of measuring site performance from a visitor's point
of view. It can measure roundtrip time, bandwidth and latency.

Roundtrip measurements are the total time it takes to initiate a
resource request to the point at which it is completely available. This
is implemented by using event handlers on window.onunload
and window.onload. The unload handler takes
the time in milliseconds and stores it in a cookie, with the URL of the
page. The onload event then compares the current time to
the one in the cookie, or attempts to use the Web

Timers can be associated with the entire page load time, or each
resource within it.

Measuring Bandwidth and Latency

Use git to download the code into a suitable location on your web

cd /var/www/my_site/
git clone http://github.com/yahoo/boomerang.git

Then create a test HTML page like this one: gist:

The important piece of code here is this:

  user_ip: ''

On a production site, the base_url would probably be a
full path to where you keep boomerang -- perhaps you have a separate
server for static files. The authors recommend setting the IP address
using server-side scripts.

The BOOMR.subscribe('before_beacon', ...) code is used
instead of a remote beacon to print bandwidth and latency statistics.
It'll take a few seconds to display the stats after loading the page.

Other Use Cases

The Boomerang documentation has a full set of use cases with code
samples: Use cases for

fairly easy to follow too.