Measuring the web with Boomerang (YUIConf 2010)
-
Upload
philip-tellis -
Category
Technology
-
view
2.988 -
download
0
Transcript of Measuring the web with Boomerang (YUIConf 2010)
IntroductionHow does it work?Using boomerang
Data
Measuring the web with boomerang
Philip Tellis / [email protected]
YUIConf 2010 – 2010-11-08
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
$ finger philip
Philip [email protected]
@bluesmoongeek - paranoid - speedfreakyahoohttp://bluesmoon.info/
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Less than 20% of page load time is something we can measureand fix during development
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
It’s what we can’t control that bites us
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
browsers
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
plugins
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
OSes
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
viruses
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
antiviruses
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
microwaves
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
baby monitors
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
naughty neighbours
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
file shares
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
governments
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
rodents
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Too many variations
Try simulating all that in the lab!
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
We need to measure real end-user performance
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
We need to measure real end-user performance from the realend-user’s box
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
While this might work, it isn’t necessarily representative
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
What about JavaScript?
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
boomerang is...
A piece of javascript that you add to your web page where itmeasures and beacons back to you, the end user’s perceivedperformance of your page
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
How?
<script src="boomerang.js" type="text/javascript"></script><script type="text/javascript">BOOMR.init({
user_ip: "<user’s ip address>",beacon_url: "http://mysite.com/beacon.php"
});</script>
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
And soon...
YUI.use(’gallery-boomr’, function(Y) {Y.BOOMR.init({
user_ip: "<user’s ip address>",beacon_url: "http://mysite.com/beacon.php"
});});
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
What does it do?
Measures user’s bandwidth and latency to your serverMeasures the current page’s load timeBeacons these results back to your server
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
TimeThe adversaryMeasure twiceboomerang
Let’s fork this talk
Do you want to:Lean how boomerang works internally?Learn how to use boomerang?
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
How does boomerang work?
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
Let’s take that one at a time
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
Measuring latency
Download a 32 byte gif 10 times in sequenceMeasure the time to download eachDiscard the first measurement because it’s overpricedCalculate the arithmetic mean, standard deviation andmargin of error of the rest
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
Wait, did you say overpriced?
The first image might require a DNS lookup and TCPhandshakeSlow start is not an issue since 32 bytes fits in 1 packet
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
Measuring bandwidth
After the latency test is done, we download progressivelylarger imagesStop at the first image that times outRedownload that image a few more timesCalculate the median, standard deviation and margin oferror of the largest images
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
Measuring latency before bandwidth helps here
Those 10 latency images do a lot to widen the TCPwindow sizeThe bandwidth images make much better use of bandwidthThe image we end with uses the most bandwidth
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
How do we measure page load time?
In the onbeforeunload event, measure the time andstore it in a cookieIn the onload event, check the cookie, and measure thedifference with the current timeWe also make sure that the page that set the cookie is thereferrer of the current page
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
What? Two pages?
Yes, this needs two pages and cookies. If those aren’tsupported, we try to use the WebTiming API.
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
LatencyBandwidthLoad timeAccuracy
How accurate is it?
Latency measurements are very accurate (±1%)Bandwidth is to an order of magnitude. For badconnections can be ±30%
Page load time sometimes has outliers, you needpost-filteringThe margin of error tells you how good your data is
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
Include it on your page
<script src="boomerang.js" type="text/javascript"></script><script type="text/javascript">BOOMR.init({
user_ip: "<user’s ip address>",beacon_url: "http://mysite.com/beacon.php"
});</script>
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
For most sites, that’s about it
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
You probably want to do more
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
Handle subdomains
Set the site_domain parameter:
BOOMR.init({user_ip: "<user’s ip address>",beacon_url: "http://mysite.com/beacon.php",site_domain: "mysite.com"
});
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
This lets you measure transitions across *.mysite.com
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
Measure more than just load time
<html><head><script>var t_pagestart=new Date().getTime();</script>...<script>var th=new Date().getTime();</script></head><body>...<script>var tj=new Date().getTime();</script>...
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
...<script src="boomerang.js"></script>...var te=new Date().getTime();BOOMR.plugins.RT.setTimer("t_head", th-t_pagestart).
setTimer("t_body", te-th).setTimer("t_js", te-tj);
</script></body></html>
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
This adds the t_head, t_body and t_js fields to the beacon
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
Loading dynamic content
BOOMR.init({user_ip: "<user’s ip address>",beacon_url: "http://mysite.com/beacon.php",auto_run: false
});
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
Loading dynamic content
// Just before download startsBOOMR.plugins.RT.startTimer("t_done");
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
Loading dynamic content
// Just after download finishesBOOMR.plugins.RT.done();
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
BasicMulti-domainIn-page timersAJAX
Much more
http://yahoo.github.com/boomerang/doc/howtos/
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
The beacon
A simple GET request to the beaconAll parameters passed in the query stringExtra timers are passed in as a comma separated list int_other
before_beacon JavaScript event fired just before thebeacon is sent
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
What should we do with the data?
Sanity checking to:Remove fake dataRemove abusive dataMaybe just rate limiting
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
What can we do with the data?
Statistical analysis to:Remove outliersAggregate based on bandwidth blocksMeasure trends over time and correlate them with codechanges
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
Bandwidth blocks
Ref: Analysing Bandwidth & Latency – YUI Blog
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
Bandwidth blocks
Data points from some countries may require narrower bands
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
Geographic data
Looking at latency from different geographic locations can tellyou where your next mirror should be
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
ISPs
Grouping data by ISP can tell you who’s behaving badly
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
More data
Write plugins to get more performance dataWe already have a DNS pluginI’m thinking of an IPv6 v/s IPv4 pluginWhat about a full WebTiming plugin?Can we measure connection setup time?
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
shouldacouldawoulda
You decide
Once you have the data, you can do anything with it
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
Thank youhttp://github.com/yahoo/boomerang
http://yahoo.github.com/boomerang/doc/
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
Photo credits
flickr.com/photos/21233184@N02/4389412851
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
Contact me
Philip [email protected]
@bluesmoongeek - paranoid - speedfreakyahoohttp://bluesmoon.info/slideshare.net/bluesmoon
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang
IntroductionHow does it work?Using boomerang
Data
References
github.com/yahoo/boomerangMore bandwidth doesn’t matter (much) – Mike BelsheAnalysing Bandwidth & Latency – YUI BlogIt’s the latency, stupid – Stuart CheshireThe statistics of web performance
YUIConf 2010 – 2010-11-08 Measuring the web with boomerang