# The other side of the moon

/bb|[^b]{2}/
Never stop Grokking

## Tuesday, January 19, 2010

### Bandwidth test v1.2

After testing this out for about a week, I'm ready to release v1.2 of the bandwidth testing code.

#### Changes

The changes in this release are all statistical, and related to the data I've collected while running the test.
1. Switch from the geometric mean to the arithmetic mean, because data for a single user is more or less centrally clustered.

This is not true across users, but for readings for a single user (single connection actually), I've found that the data does not really have outliers.
You can now set PERFORMANCE.BWTest.sample to a number between 0 and 100, and that's the percentage of page views that will be tested for bandwidth. Note that this is not an integer, so you can set it to 0.1 or 10.25, or anything as long as it's between 0 and 100 (both inclusive). Setting it to 0 means that the test isn't run for anyone, so you probably don't want that, and 100 means that the test is run for everybody. This is also the default.
4. Fire an onload event when the script completes loading. This is mainly so that you can asynchronously load the script so that it does not affect your page load time. Instead of checking for script.onload or onreadystatechange, you can just implement the PERFORMANCE.BWTest.onload method.