├── .gitignore ├── LICENSE.txt ├── Makefile ├── README.md ├── boomerang-0.9.1280532889.js ├── boomerang.js ├── dns.js ├── doc ├── TODO.txt ├── api │ ├── BOOMR.html │ ├── BOOMR.utils.html │ ├── BW.html │ ├── DNS.html │ ├── RT.html │ ├── index.html │ ├── ipv6.html │ └── navtiming.html ├── boomerang-docs.css ├── community.html ├── howtos │ ├── dynamic-content.txt │ ├── howto-0.html │ ├── howto-10-page#1.html │ ├── howto-10-page#2.html │ ├── howto-1a-page#1.html │ ├── howto-1a-page#2.html │ ├── howto-1b-page#1.html │ ├── howto-1b-page#2.html │ ├── howto-2.html │ ├── howto-3.html │ ├── howto-4.html │ ├── howto-5.html │ ├── howto-6.html │ ├── howto-7.html │ ├── howto-8.html │ ├── howto-9.html │ ├── howtos.js │ └── index.html ├── index.html ├── ja │ ├── TODO.txt │ ├── api │ │ ├── BOOMR.html │ │ ├── BOOMR.utils.html │ │ ├── BW.html │ │ ├── DNS.html │ │ ├── RT.html │ │ ├── index.html │ │ ├── ipv6.html │ │ └── navtiming.html │ ├── community.html │ ├── howtos │ │ ├── dynamic-content.txt │ │ ├── howto-0.html │ │ ├── howto-10-page#1.html │ │ ├── howto-10-page#2.html │ │ ├── howto-1a-page#1.html │ │ ├── howto-1a-page#2.html │ │ ├── howto-1b-page#1.html │ │ ├── howto-1b-page#2.html │ │ ├── howto-2.html │ │ ├── howto-3.html │ │ ├── howto-4.html │ │ ├── howto-5.html │ │ ├── howto-6.html │ │ ├── howto-7.html │ │ ├── howto-8.html │ │ ├── howto-9.html │ │ └── index.html │ ├── index.html │ ├── methodology.html │ ├── press.html │ └── use-cases.html ├── methodology.html ├── press.html └── use-cases.html ├── images ├── image-0.png ├── image-1.png ├── image-2.png ├── image-3.png ├── image-4.png ├── image-5.png ├── image-6.png └── image-l.gif ├── ipv6.js ├── navtiming.js ├── plugin.js ├── tests ├── 1-basic.html ├── 2-init.html ├── 3-initparams.html ├── 4-event.html └── index.html └── zzz_last_plugin.js /.gitignore: -------------------------------------------------------------------------------- 1 | .gitignore 2 | *.gz 3 | boomerang-*.js 4 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Software Copyright License Agreement (BSD License) 2 | 3 | Copyright (c) 2010, Yahoo! Inc. 4 | All rights reserved. 5 | 6 | Redistribution and use of this software in source and binary forms, 7 | with or without modification, are permitted provided that the following 8 | conditions are met: 9 | 10 | * Redistributions of source code must retain the above 11 | copyright notice, this list of conditions and the 12 | following disclaimer. 13 | 14 | * Redistributions in binary form must reproduce the above 15 | copyright notice, this list of conditions and the 16 | following disclaimer in the documentation and/or other 17 | materials provided with the distribution. 18 | 19 | * Neither the name of Yahoo! Inc. nor the names of its 20 | contributors may be used to endorse or promote products 21 | derived from this software without specific prior 22 | written permission of Yahoo! Inc. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 25 | IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 26 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 27 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 28 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 29 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 30 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011, Yahoo! Inc. All rights reserved. 2 | # Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms. 3 | 4 | PLUGINS := 5 | 6 | VERSION := $(shell sed -ne '/^BOOMR\.version/{s/^.*"\([^"]*\)".*/\1/;p;q;}' boomerang.js) 7 | DATE := $(shell date +%s) 8 | 9 | MINIFIER := cat 10 | 11 | all: boomerang-$(VERSION).$(DATE).js 12 | 13 | usage: 14 | echo "Create a release version of boomerang:" 15 | echo " make" 16 | echo "" 17 | echo "Create a release version of boomerang with the dns plugin:" 18 | echo " make PLUGINS=dns.js" 19 | echo "" 20 | echo "Create a yuicompressor minified release version of boomerang:" 21 | echo " make MINIFIER=\"java -jar /path/to/yuicompressor-2.4.2.jar --type js\"" 22 | echo "" 23 | echo "Create a jsmin minified release version of boomerang:" 24 | echo " make MINIFIER=\"/path/to/jsmin\"" 25 | echo "" 26 | 27 | boomerang-$(VERSION).$(DATE).js: boomerang.js $(PLUGINS) 28 | echo 29 | echo "Making $@ ..." 30 | echo "using plugins: $(PLUGINS)..." 31 | cat boomerang.js $(PLUGINS) zzz_last_plugin.js | sed -e 's/^\(BOOMR\.version = "\)$(VERSION)\("\)/\1$(VERSION).$(DATE)\2/' | $(MINIFIER) | perl -pe "s/\(window\)\);/\(window\)\);\n/g" > $@ && echo "done" 32 | echo 33 | 34 | .PHONY: all 35 | .SILENT: 36 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, Yahoo! Inc. All rights reserved. 2 | Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms. 3 | 4 | boomerang always comes back, except when it hits something. 5 | 6 | This piece of javascript measures a whole bunch of performance characteristics of your user's 7 | web browsing experience. All you have to do is stick it into your web pages and call the 8 | init() method. 9 | 10 | documentation is in the docs/ directory, it's all HTML, so your best bet is to check it out 11 | and view it locally, though it works best through a web server (you'll need cookies). 12 | 13 | An online version of the docs is here: http://lognormal.github.com/boomerang/doc/ 14 | 15 | The latest code and docs is available on http://github.com/lognormal/boomerang/ 16 | 17 | Discussions are best done using github issues at https://github.com/lognormal/boomerang/issues 18 | You'll need a github account to participate. 19 | -------------------------------------------------------------------------------- /dns.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011, Yahoo! Inc. All rights reserved. 3 | * Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms. 4 | */ 5 | 6 | /** 7 | \file dns.js 8 | Plugin to measure DNS latency. 9 | This code is based on Carlos Bueno's guide to DNS on the YDN blog: 10 | http://developer.yahoo.net/blog/archives/2009/11/guide_to_dns.html 11 | */ 12 | 13 | // w is the window object 14 | (function(w) { 15 | 16 | BOOMR = BOOMR || {}; 17 | BOOMR.plugins = BOOMR.plugins || {}; 18 | 19 | var impl = { 20 | complete: false, 21 | base_url: "", 22 | t_start: null, 23 | t_dns: null, 24 | t_http: null, 25 | img: null, 26 | 27 | gen_url: "", 28 | 29 | start: function() { 30 | var random = Math.floor(Math.random()*(2147483647)).toString(36), 31 | cache_bust = "" + (new Date().getTime()) + (Math.random()); 32 | 33 | this.gen_url = this.base_url.replace(/\*/, random); 34 | 35 | impl.img = new Image(); 36 | impl.img.onload = impl.A_loaded; 37 | 38 | impl.t_start = new Date().getTime(); 39 | impl.img.src = this.gen_url + "image-l.gif?t=" + cache_bust; 40 | }, 41 | 42 | A_loaded: function() { 43 | var cache_bust; 44 | impl.t_dns = new Date().getTime() - impl.t_start; 45 | 46 | cache_bust = "" + (new Date().getTime()) + (Math.random()); 47 | 48 | impl.img = new Image(); 49 | impl.img.onload = impl.B_loaded; 50 | 51 | impl.t_start = new Date().getTime(); 52 | impl.img.src = impl.gen_url + "image-l.gif?t=" + cache_bust; 53 | }, 54 | 55 | B_loaded: function() { 56 | impl.t_http = new Date().getTime() - impl.t_start; 57 | 58 | impl.img = null; 59 | impl.done(); 60 | }, 61 | 62 | done: function() { 63 | // DNS time is the time to load the image with uncached DNS 64 | // minus the time to load the image with cached DNS 65 | 66 | var dns = impl.t_dns - impl.t_http; 67 | 68 | BOOMR.addVar("dns", dns); 69 | this.complete = true; 70 | BOOMR.sendBeacon(); 71 | }, 72 | 73 | read_timing_api: function(t) { 74 | if(typeof t.domainLookupStart === "undefined" 75 | || typeof t.domainLookupEnd === "undefined") { 76 | return false; 77 | } 78 | 79 | // This will be 0 if we read DNS from cache, but that's what 80 | // we want because it's what the user experiences 81 | BOOMR.addVar("dns", t.domainLookupEnd - t.domainLookupStart); 82 | 83 | impl.complete = true; 84 | 85 | return true; 86 | } 87 | }; 88 | 89 | BOOMR.plugins.DNS = { 90 | init: function(config) { 91 | BOOMR.utils.pluginConfig(impl, config, "DNS", ["base_url"]); 92 | 93 | // If this browser supports the WebTiming API, then we just 94 | // use that and don't bother doing the test 95 | if(w.performance && w.performance.timing) { 96 | if(impl.read_timing_api(w.performance.timing)) { 97 | return this; 98 | } 99 | } 100 | 101 | if(!impl.base_url) { 102 | BOOMR.warn("DNS.base_url is not set. Cannot run DNS test.", "dns"); 103 | impl.complete = true; // set to true so that is_complete doesn't 104 | // block other plugins 105 | return this; 106 | } 107 | 108 | // make sure that dns test images use the same protocol as the host page 109 | if(w.location.protocol === 'https:') { 110 | impl.base_url = impl.base_url.replace(/^http:/, 'https:'); 111 | } 112 | else { 113 | impl.base_url = impl.base_url.replace(/^https:/, 'http:'); 114 | } 115 | 116 | BOOMR.subscribe("page_ready", impl.start, null, this); 117 | 118 | return this; 119 | }, 120 | 121 | is_complete: function() { 122 | return impl.complete; 123 | } 124 | }; 125 | 126 | }(window)); 127 | 128 | -------------------------------------------------------------------------------- /doc/TODO.txt: -------------------------------------------------------------------------------- 1 | 1. Add random sampling 2 | This needs to be a little intelligent because plugins may have different 3 | criteria for sampling. For example, the RT plugin requires two pages -- 4 | one for tstart and one for tend. Since tstart is a relatively inexpensive 5 | operation, it makes sense for us to set tstart on all pages, but only set 6 | tend based on the random sample. 7 | 8 | 2. Measure time from page start to page_load 9 | Since we may not always have control over the exact moment the user 10 | initiated a request for our page, the next best thing would be to measure 11 | the time from the first byte to reach the user to the time the page loaded. 12 | 13 | Note that comparing with server time is not a good idea since the user's 14 | system clock may not actually be correct. 15 | 16 | See use-case #1c & #1d. 17 | 18 | 3. Rewrite bandwidth testing code to be pretty and clean 19 | 20 | 4. Create a yui-gallery module 21 | -------------------------------------------------------------------------------- /doc/api/BOOMR.utils.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BOOMR utility functions 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

BOOMR utility functions

11 |

12 | All boomerang utility functions are under the BOOMR.utils namespace. 13 | To access any of the following, dereference the BOOMR.utils object. eg: use BOOMR.utils.getCookie() 14 | to call the getCookie() method. 15 |

16 | 17 |

Methods

18 | 19 |
20 | 21 |
getCookie(sName)
22 |
23 |

24 | Gets the value of the cookie identified by sName. 25 |

26 |

Returns

27 | 31 |
32 | 33 |
setCookie(sName, oSubCookies, nMaxAge, sPath, sDomain, bSecure)
34 |
35 |

36 | Sets the cookie named sName to the serialized value of oSubCookies. 37 |

38 |

Parameters:

39 |
40 | 41 |
sName
42 |
The name of the cookie
43 | 44 |
oSubCookies
45 |
key/value pairs to write into the cookie. These will be serialized as an & separated 46 | list of URL encoded key=value pairs.
47 | 48 |
nMaxAge
49 |
Lifetime in seconds of the cookie. Set this to 0 to create a session cookie that expires when the browser 50 | is closed. If not set, defaults to 0.
51 | 52 |
sPath
53 |
The HTTP path that the cookie should be valid for. The cookie will be sent to all URLs on this domain that 54 | fall below sPath. If not set, defaults to the path of the current document. Unless you're on a server where 55 | multiple users share the same domain, you probably want to set this to /
56 | 57 |
sDomain
58 |
The HTTP domain that the cookie should be vali for. The cookie will be sent to all URLs that are subdomains 59 | of this domain. If not set, defaults to the current document's domain. If set to null, it will 60 | use the value of site_domain that was configured during the call to BOOMR.init(). 61 | You probably want to set this to null. 62 |
63 | 64 |
bSecure
65 |
If set to true, then this cookie is only sent to HTTPS URLs. If set to false (or not set), this cookie is sent to all 66 | URLs that match the above rules. Unless your site is completely SSL based, you can leave this unset.
67 |
68 | 69 |

70 | Note that the entire cookie name and value needs to be less than 4000 characters. 71 |

72 | 73 |

Example:

74 |

75 | The BOOMR.plugins.RT plugin uses this function like this: 76 |

77 |
 78 | if(!BOOMR.utils.setCookie(
 79 | 			impl.cookie,
 80 | 			{ s: t_start, r: url },
 81 | 			impl.cookie_exp,
 82 | 			"/",
 83 | 			null
 84 | 		)) {
 85 | 	BOOMR.error("cannot set start cookie", "rt");
 86 | 	return this;
 87 | }
 88 | 
89 | 90 |

Returns

91 | 95 |
96 | 97 |
getSubCookies(sCookie)
98 |
99 |

100 | Parse a cookie string returned by getCookie() and split it into its constituent subcookies. 101 |

102 |

Example:

103 |

104 | The BOOMR.plugins.BW plugin calls this function like this: 105 |

106 |
107 | var cookies = BOOMR.utils.getSubCookies(BOOMR.utils.getCookie(impl.cookie));
108 | 
109 |

Returns

110 | 114 |
115 | 116 |
removeCookie(sName)
117 |
118 |

119 | Removes the cookie identified by sName by nullifying its value, and making it a session cookie. 120 |

121 |

Returns

122 |

123 | Nothing useful. 124 |

125 |
126 | 127 |
pluginConfig(oImpl, oConfig, sName, aProperties)
128 |
129 |

130 | Convenience method that plugins can call to configure themselves with the config object passed in to their init() 131 | method. 132 |

133 |

Parameters:

134 |
135 |
oImpl
136 |
The plugin's impl object within which it stores all its configuration and private properties
137 | 138 |
oConfig
139 |
The config object passed in to the plugin's init() method.
140 | 141 |
sName
142 |
The plugin's name in the BOOMR.plugins object.
143 | 144 |
aProperties
145 |
An array containing a list of all configurable properties that this plugin has.
146 |
147 | 148 |

Example:

149 |

150 | The BOOMR.plugins.RT plugin uses this method like this: 151 |

152 |
153 | BOOMR.utils.pluginConfig(impl, config, "RT", ["cookie", "cookie_exp", "strict_referrer"]);
154 | 
155 | 156 |

Returns

157 | 161 |
162 | 163 |
164 | 165 | 168 | 169 | 170 | 171 | 175 | -------------------------------------------------------------------------------- /doc/api/BW.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Bandwidth/latency plugin API 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Bandwidth/latency plugin API

11 |

12 | The bandwidth plugin measures the bandwidth and latency of the user's network connection to your 13 | server. The bandwidth API is encapsulated within the BOOMR.plugins.BW namespace. 14 |

15 | 16 |

Configuration

17 |

18 | All bandwidth plugin configuration items are under the BW namespace. 19 | The full configuration object is described in Howto #6 — Configuring boomerang. 20 |

21 |
22 |
base_url
23 |
24 | [recommended] 25 | By default, the bandwidth plugin looks for its bandwidth measurement images in the images/ subdirectory 26 | of the current directory. This may not be true for all pages on your site. You can set the base_url 27 | parameter to the HTTP path of the directory that contains the bandwidth images. This can be an absolute or a relative 28 | URL. If it's relative, remember that it's relative to the page that boomerang is included in and not to the javascript 29 | file. 30 |
31 | 32 |
cookie
33 |
34 | [optional] 35 | The name of the cookie in which to store the measured bandwidth and latency of the user's network connection. 36 | The default name is BA. See Howto #3 for more details on the bandwidth cookie. 37 |
38 | 39 |
cookie_exp
40 |
41 | [optional] 42 | The lifetime in seconds of the bandwidth cookie. The default is set to 7 days. This specifies how long it will be before 43 | we run the bandwidth test again for a user, assuming their IP address doesn't change within this time. You probably do 44 | not need to change this setting at all since the bandwidth of a given network connection typically does not change by an 45 | order of magnitude on a regular basis.
46 | Note that if you're doing some kind of real-time streaming, then chances are that this bandwidth test isn't right for you, 47 | so setting this cookie to a shorter value isn't the right solution. 48 |
49 | 50 |
timeout
51 |
52 | [optional] 53 | The timeout in seconds for the entire bandwidth test. The default is set to 15 seconds. The bandwidth test can run for 54 | a long time, and sometimes, due to network errors, it might never complete. The timeout forces the test to complete at 55 | that time. This is a hard limit. If the timeout fires, we stop further iterations of the test and attempt to calculate 56 | bandwidth with the data that we've collected at that point. Increasing the timeout can get you more data and increase 57 | the accuracy of the test, but at the same time increases the risk of the test not completing before the user leaves the 58 | page. 59 |
60 | 61 |
nruns
62 |
63 | [optional] 64 | The number of times the bandwidth test should run. The default is set to 5. The first test is always a pilot to figure 65 | out the best way to proceed with the remaining tests. Increasing this number will increase the tests accuracy, but at 66 | the same time increases the risk that the test will timeout. It should take about 2-4 seconds per run, so consider this 67 | value along with the timeout value above. 68 |
69 | 70 |
71 | 72 | 73 |

Methods

74 | 75 |
76 | 77 |
init(oConfig)
78 |
79 |

80 | Called by the BOOMR.init() method to configure the bandwidth 81 | plugin. 82 |

83 |

Parameters

84 |
85 |
oConfig
86 |
The configuration object passed in via BOOMR.init(). See the Configuration section for details. 87 |
88 |

Returns

89 |

90 | a reference to the BOOMR.plugins.BW object, so you can chain methods. 91 |

92 |
93 | 94 |
run()
95 |
96 |

97 | Starts the bandwidth test. This method is called automatically when boomerang's 98 | page_ready event fires, so you won't need to call it 99 | yourself. 100 |

101 |

Returns

102 |

103 | a reference to the BOOMR.plugins.BW object, so you can chain methods. 104 |

105 |
106 | 107 |
abort()
108 |
109 |

110 | Stops the bandwidth test immediately and attempts to calculate bandwidth and latency 111 | from values that it has already gathered. This method is called automatically if the 112 | bandwidth test times out. It is better to set the timeout value appropriately 113 | when calling the BOOMR.init() method. 114 |

115 |

Returns

116 |

117 | a reference to the BOOMR.plugins.BW object, so you can chain methods. 118 |

119 |
120 | 121 |
is_complete()
122 |
123 |

124 | Called by BOOMR.sendBeacon() to determine if the bandwidth plugin has 125 | finished what it's doing or not. 126 |

127 |

Returns

128 | 132 |
133 | 134 |
135 | 136 |

Beacon Parameters

137 |

138 | This plugin adds the following parameters to the beacon: 139 |

140 |
141 |
bw
User's measured bandwidth in bytes per second
142 |
bw_err
95% confidence interval margin of error in measuring user's bandwidth
143 |
lat
User's measured HTTP latency in milliseconds
144 |
lat_err
95% confidence interval margin of error in measuring user's latency
145 |
bw_time
Timestamp (seconds since the epoch) on the user's browser when the bandwidth and latency was measured
146 |
147 | 148 | 149 | 152 | 153 | 154 | 155 | 159 | -------------------------------------------------------------------------------- /doc/api/DNS.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DNS latency plugin API 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

DNS latency plugin API

11 |

12 | Note: The DNS plugin hasn't been tested. Your help in testing it is appreciated. 13 |

14 |

15 | The DNS plugin measures the latency of DNS lookups from the user's browser to your server. 16 | The DNS API is encapsulated within the BOOMR.plugins.DNS namespace. 17 |

18 | 19 |

20 | Note that the DNS plugin requires some amount of server-side set up. See 21 | Howto #8 for details on how to set this up. 22 |

23 | 24 |

Methods

25 | 26 |
27 | 28 |
init(oConfig)
29 |
30 |

31 | Called by the BOOMR.init() method to configure the DNS 32 | plugin. There is only one configurable option: 33 |

34 |
35 |
base_url
36 |
37 | [required] 38 | The base_url parameter tells the DNS plugin where it can find its DNS testing 39 | images. This URL must contain a wildcard character which will be replaced with a random 40 | string. The images will be appended to this string without any other modification. If you 41 | have any pages served over HTTPS, then this URL should be configured to work over HTTPS as 42 | well as HTTP. The protocol part of the URL will be automatically changed to fit the current 43 | document. 44 |
45 |
46 |
 47 | BOOMR.init({
 48 | 		DNS: {                                                  
 49 | 		            base_url: "http://*.yoursite.com/images/"   
 50 | 		}                                                       
 51 | 	});
 52 | 
53 |

54 | In the above code, * will be replaced with a random string. 55 |

56 | 57 |

Returns

58 |

59 | a reference to the BOOMR.plugins.DNS object, so you can chain methods. 60 |

61 |

Note

62 |

63 | The DNS test will not run if a base_url is not configured. 64 |

65 |
66 | 67 |
is_complete()
68 |
69 |

70 | Called by BOOMR.sendBeacon() to determine if the DNS plugin has 71 | finished what it's doing or not. 72 |

73 |

Returns

74 | 78 |
79 | 80 |
81 | 82 |

Beacon Parameters

83 |

84 | This plugin adds the following parameter to the beacon: 85 |

86 |
87 |
dns
88 |
The worst-case DNS latency from the user's browser to your DNS server.
89 |
90 | 91 | 94 | 95 | 96 | 97 | 101 | -------------------------------------------------------------------------------- /doc/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Boomerang API 6 | 7 | 8 | 9 | All Docs 10 |

The boomerang API

11 |

core

12 | 16 | 17 |

core plugins

18 | 22 | 23 |

extra plugins

24 | 32 | 33 | 36 | 37 | 38 | 39 | 43 | -------------------------------------------------------------------------------- /doc/api/ipv6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IPv6 plugin API 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

IPv6 plugin API

11 |

12 | Note: The IPv6 plugin hasn't been tested. Your help in testing it is appreciated. 13 |

14 |

15 | The IPv6 plugin measures various IPv6 related metrics. It is encapsulated within 16 | the BOOMR.plugins.IPv6 namespace. This plugin tries to do a few things: 17 |

18 | 24 |

25 | This plugin needs a server that has an IPv6 address, and a DNS name to point to it. 26 | Additionally, the server needs to be configured to serve content requested 27 | from the IPv6 address and should not require a virtual host name. This means 28 | that you probably cannot use shared hosting that puts multiple hosts on the 29 | same IP address. 30 |

31 | 32 |

Configuration

33 |

34 | All configuration parameters are within the IPv6 namespace. 35 |

36 |
37 |
ipv6_url
38 |
An image URL referenced by its IPv6 address, eg, http://fe80::1/image-i.png. 39 | If not specified, the test will abort.
40 |
host_url
41 |
[recommended] 42 | An image URL on an IPv6 only host referenced by its DNS hostname. The hostname should not 43 | resolve to an IPv4 address. If not specified, the host test will be skipped. 44 |
45 |
timeout
46 |
[optional] 47 | The time, in milliseconds, that boomerang should wait for a network response before giving up 48 | and assuming that the request failed. The default is 1200ms. 49 |
50 |
51 | 52 |

Methods

53 | 54 |
55 | 56 |
init(oConfig)
57 |
58 |

59 | Called by the BOOMR.init() method to configure the DNS 60 | plugin. See the Configuration section for details. 61 |

62 |
 63 | BOOMR.init({
 64 | 		IPv6: {                                                         
 65 | 		            ipv6_url: "http://fe80::1/images/image-i.png"       
 66 | 		            host_url: "http://yoursite-6.com/images/image-i.png"
 67 | 		}                                                               
 68 | 	});
 69 | 
70 | 71 |

Returns

72 |

73 | a reference to the BOOMR.plugins.IPv6 object, so you can chain methods. 74 |

75 |

Note

76 |

77 | The IPv6 test will not run if a ipv6_url is not configured. 78 |

79 |
80 | 81 |
is_complete()
82 |
83 |

84 | Called by BOOMR.sendBeacon() to determine if the IPv6 plugin has 85 | finished what it's doing or not. 86 |

87 |

Returns

88 | 92 |
93 | 94 |
95 | 96 |

Beacon Parameters

97 |

98 | This plugin adds two parameters to the beacon, both prefixed with ipv6_: 99 |

100 |
101 |
ipv6_latency
102 |
Latency in milliseconds of getting data from an ipv6 host when connecting to the IP. 103 | Will be set to NA if the client cannot connect to the ipv6 host.
104 |
ipv6_lookup
105 |
Latency of getting data from a hostname that resolves to an ipv6 address. Will be set 106 | to NA if the client cannot resolve or connect to the ipv6 host.
107 |
108 | 109 | 112 | 113 | 114 | 115 | 119 | -------------------------------------------------------------------------------- /doc/api/navtiming.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Navigation Timing plugin API 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Navigation Timing plugin API

11 |

12 | Note: The Navigation Timing plugin hasn't been tested. Your help in testing it is appreciated. 13 |

14 |

15 | The Navigation Timing plugin collects metrics collected by modern user agents that support the 16 | W3C Navigation Timing specification. The Navigation 17 | Timing API is encapsulated within the BOOMR.plugins.NavigationTiming namespace. 18 |

19 | 20 |

21 | Note that the Navigation Timing plugin isn't included by default in boomerang.js. See 22 | Howto #9 for details on how to include the plugin in your boomerang 23 | deployment. 24 |

25 | 26 |

Methods

27 | 28 |
29 | 30 |
init()
31 |
32 |

33 | Called by the BOOMR.init() method to configure the Navigation Timing 34 | plugin. The Navigation Timing plugin doesn't require any configuration parameters, since it simply 35 | reads values out of the browser's window.performance object (if available) and adds them to the 36 | beacon query string. 37 |

38 | 39 |

Returns

40 |

41 | a reference to the BOOMR.plugins.NavigationTiming object, so you can chain methods. 42 |

43 |

Note

44 |

45 | If the user agent being examined doesn't implement the Navigation Timing spec, the plugin won't 46 | add any parameters to the beacon. 47 |

48 |
49 | 50 |
is_complete()
51 |
52 |

53 | Called by BOOMR.sendBeacon() to determine 54 | if the Navigation Timing plugin has finished what it's doing or not. 55 |

56 |

Returns

57 | 61 |
62 | 63 |
64 | 65 |

Beacon Parameters

66 |

67 | The NavigationTiming plugin adds the following parameters to the beacon. Each maps onto a attribute from the 68 | browser's NavigationTiming API. 69 |

70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 |
Beacon parameterNavigationTiming attribute
nt_red_cntwindow.performance.navigation.redirectCount
nt_nav_typewindow.performance.navigation.type
nt_nav_stwindow.performance.timing.navigationStart
nt_red_stwindow.performance.timing.redirectStart
nt_red_endwindow.performance.timing.redirectEnd
nt_fet_stwindow.performance.timing.fetchStart
nt_dns_stwindow.performance.timing.domainLookupStart
nt_dns_endwindow.performance.timing.domainLookupEnd
nt_con_stwindow.performance.timing.connectStart
nt_con_endwindow.performance.timing.connectEnd
nt_req_stwindow.performance.timing.requestStart
nt_res_stwindow.performance.timing.responseStart
nt_res_endwindow.performance.timing.responseEnd
nt_domloadingwindow.performance.timing.domLoading
nt_domintwindow.performance.timing.domInteractive
nt_domcontloaded_stwindow.performance.timing.domContentLoadedEventStart
nt_domcontloaded_endwindow.performance.timing.domContentLoadedEventEnd
nt_domcompwindow.performance.timing.domComplete
nt_load_stwindow.performance.timing.loadEventStart
nt_load_endwindow.performance.timing.loadEventEnd
nt_unload_stwindow.performance.timing.unloadEventStart
nt_unload_endwindow.performance.timing.unloadEventEnd
nt_ssl_st[optional] window.performance.secureConnectionStart
99 | 100 | 103 | 104 | 105 | 106 | 110 | -------------------------------------------------------------------------------- /doc/boomerang-docs.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011, Yahoo! Inc. All rights reserved. 3 | * Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms. 4 | */ 5 | 6 | body { font-size: 0.9em; background-color: #eeeee4; padding: 5% 10% 15% 10%; margin: 0; font-family: "Trebuchet MS",Trebuchet,Tahoma,Verdana,Sans-Serif; } 7 | a { color: #571; } 8 | a:hover, a:active { color: #350; } 9 | h1 { padding-left: .8in; text-indent: -.8in; } 10 | h2, h2 a, h3, h3 a, h4, h4 a { color:#793; } 11 | 12 | p#results { background-color: #ffa; border: solid 2px #d82; padding: 1em; position: absolute; width: 25%; overflow: hidden; white-space: pre;} 13 | p#results:hover { width: auto; } 14 | div#dynamic-content { font-size: 0.5em; border: solid 3px #9a5; padding: 1em; margin: 1em 10% 1em 40%; text-align: justify; color: #9a8; } 15 | div#dynamic-content > p:first-child { font-size: 2em; } 16 | 17 | dd strong { color: #a43; background-color: #ddc; } 18 | dd h3 { color: black; margin-left: -0.8em; } 19 | 20 | dl.api {border-bottom: solid 1px #aaa; } 21 | dl.api > dt { font-weight: bolder; border-top: solid 1px #aaa; padding: 3px; } 22 | dl.api > dd { font-size: 0.9em; color: #222; } 23 | dl.api > dd > ul { padding-bottom: 0.5em; } 24 | 25 | p.perma-link { margin-top: 4em; font-size: 0.9em; } 26 | 27 | pre { line-height:1.4em; font-size: 1.1em; margin-right: 4%; padding: 1em 1em 1em 1.5em; background-color: #bba; border-left: solid 5px #9a5; } 28 | pre em { background-color: #ccb; color: #a32; font-style: normal; padding: 2px;} 29 | pre span.comment { background-color: #ccb; color: #56a; padding: 2px;} 30 | 31 | pre span.ni { color: #886; } 32 | 33 | a.fn { position: relative; top: -0.4em; font-size: 0.7em; text-decoration: none; } 34 | #footnotes { font-size: 0.8em; width: 50%; text-align: justify; border-top: solid 1px #888; padding-right: 0.5em; margin: 3em 0 0 0;} 35 | #footnotes li { margin-bottom: 0.8em; } 36 | -------------------------------------------------------------------------------- /doc/community.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | boomerang community 6 | 7 | 8 | 9 | All Docs 10 |

boomerang community

11 |

12 | boomerang is an opensource javascript library released under the BSD license. 13 | It depends on its community to keep it alive. 14 |

15 | 16 |

Source code

17 |

18 | The source code is on github at github.com/lognormal/boomerang. Feel 19 | free to fork it and contribute to it. You can also get a tarball 20 | or zip archive of the code. 21 |

22 | 23 |

Bugs & Discussions

24 |

25 | Use github's issue tracking system to report or follow bugs or to 26 | discuss features and get support. 27 |

28 | 29 |

Other projects

30 |

31 | Other opensource devs have incorporated boomerang into their own projects. The following is a partial list: 32 |

33 | 36 | 37 | 38 | 39 | 43 | -------------------------------------------------------------------------------- /doc/howtos/howto-10-page#1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #10: Load time of a page prerendered by Google Chrome 5 | 6 | 7 | 8 | 9 | 10 | all docs | index 11 |

boomerang howto #10:
load time of a page prerendered by Google Chrome

12 |

13 | This use case is based on Google Chrome's prerender 14 | capabilities introduced with Chrome 13. The code to include on a page is the same regardless 15 | of whether you use prerender or not, so this howto will not cover that. However, to enable 16 | prerendering of a particular page, you include that page's URL as a link element in the current 17 | document. For example, we include this code in the HEAD of the current page: 18 |

19 |
20 | <link rel="prerender" href="howto-10-page%232.html">
21 | 
22 |

23 | This tells Chrome to prefetch howto-10-page#2.html and all its assets, and to 24 | start rendering it in the background, invisible to the user. When the user eventually clicks 25 | on a link to that document, it should show up immediately. 26 |

27 |

28 | As performance concious engineers, however, we'd like to know how long it all took. In 29 | particular, the numbers we care about are: 30 |

31 |
    32 |
  1. Time from click to display
  2. 33 |
  3. Time from fetchStart/navigationStart to prerender finish
  4. 34 |
  5. Time from fetchStart/navigationStart to display
  6. 35 |
  7. Time from prerender finish to display
  8. 36 |
37 |

38 | Let's hope you've spent enough time reading this page to allow page#2's rendering to complete. 39 |

40 | 41 |

42 | Go to Page #2 now to see the results of the page load test. 43 |

44 | 45 | 48 | 49 |

50 |

51 | 52 | 53 | 54 | 64 | 65 | 66 | 70 | -------------------------------------------------------------------------------- /doc/howtos/howto-10-page#2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #10: Load time of a page prerendered by Google Chrome 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

boomerang howto #10:
load time of a page prerendered by Google Chrome

11 |

12 | This use case is based on Google Chrome's prerender 13 | capabilities introduced with Chrome 13. We use two pages for this use case. This is page #2 of the 14 | example. See Page #1 for the full explanation. 15 |

16 | 17 |

18 | If you clicked the link to this page from Page #1, you should see 19 | page performance results show up below. It may take a while if this is the first time you're doing 20 | the test since testing your bandwidth takes about 6 seconds. You can also click the link to Page #1 21 | to see the same output on Page #1. 22 |

23 | 24 |

25 | In the box below, if rt.start is set to cookie, you should see the following numbers: 26 |

27 |
    28 |
  1. t_done (load time): Time from click to display (perceived load time)
  2. 29 |
  3. t_load: Time from fetchStart/navigationStart to prerender finish
  4. 30 |
  5. t_prerender: Time from fetchStart/navigationStart to display
  6. 31 |
  7. t_postrender: Time from prerender finish to display
  8. 32 |
33 |

34 | If rt.start is set to navigation (or something else), then t_done is the same as t_prerender. If t_prerender is not set, then this 35 | page wasn't prerendered, and t_done is the actual perceived load time. 36 |

37 | 38 | 41 | 42 |

43 |

44 | 45 | 46 | 47 | 57 | 58 | 59 | 63 | -------------------------------------------------------------------------------- /doc/howtos/howto-1a-page#1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #1a: User clicks a link on a page we control and page is usable when onload fires 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #1a:
User clicks a link on a page we control and page is usable when onload fires

11 |

12 | See use case #1 for a description of this requirement. 13 |

14 |

15 | We use two pages for this use case. They may be any two pages on your site, and the code you put into them 16 | is identical, so you could just put it on all pages on your site. Assuming you're starting out with nothing, 17 | this is what you do: 18 |

19 |
    20 |
  1. Copy boomerang.js and the images/ directory into your document root
  2. 21 |
  3. Add the code below to all your pages:
  4. 22 |
23 |
24 | <script src="boomerang.js" type="text/javascript"></script>
25 | <script type="text/javascript">
26 | BOOMR.init({
27 | 		user_ip: "<user's ip address>",
28 | 		beacon_url: "http://yoursite.com/path/to/beacon.php"
29 | 	});
30 | </script>
31 | 
32 |

33 | This should be sufficient to measure page load time on all but the very first page that a user visits on 34 | your site. You'll need to get the user's IP address using some server-side programming 35 | language like PHP, Python or C#. This is necessary in order to save bandwidth calculations 36 | across requests, and makes it a little easier on your users. 37 |

38 | 39 |

40 | Go to Page #2 now to see the results of the page load test. 41 |

42 | 43 |

More complex sites

44 |

45 | If you've been doing this website thing for a while, chances are that you use a CDN 46 | to host your javascript, and have several subdirectories with pages. If you do that, 47 | then change the link to boomerang.js above to point to the absolute location 48 | of that file. You will also need to tell boomerang where to find its bandwidth testing 49 | images. Your init() call will then change to this: 50 |

51 |
52 | BOOMR.init({
53 | 		user_ip: "<user's ip address>",
54 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
55 | 		BW: {
56 | 			base_url: "http://yoursite.com/path/to/bandwidth/images/"
57 | 		}
58 | 	});
59 | 
60 |

61 | Note, that you point to the image directory. It is recommended that you put these 62 | images on a server that you want to measure the user's bandwidth and latency to. 63 | In most cases this will be your own server, however, there may be cases where you'd 64 | want to put them on a CDN and measure bandwidth and latency to those servers instead. 65 | This decision is left up to you. We recommend putting them on your own server. 66 |

67 | 68 |

69 | Go to Page #2 now to see the results of the page load test. 70 |

71 | 72 | 75 | 76 |

77 |

78 | 79 | 80 | 81 | 93 | 94 | 95 | 99 | -------------------------------------------------------------------------------- /doc/howtos/howto-1a-page#2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #1a: User clicks a link on a page we control and page is usable when onload fires 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #1a:
User clicks a link on a page we control and page is usable when onload fires

11 |

12 | See use case #1 for a description of this requirement. 13 |

14 |

15 | We use two pages for this use case. This is page #2 of the example. See Page #1 16 | for full explanation. 17 |

18 | 19 |

20 | If you clicked the link to this page from Page #1, you should see 21 | page performance results show up below. It may take a while if this is the first time you're doing 22 | the test since testing your bandwidth takes about 6 seconds. You can also click the link to Page #1 23 | to see the same output on Page #1. 24 |

25 | 26 | 29 | 30 |

31 |

32 | 33 | 34 | 35 | 47 | 48 | 49 | 53 | -------------------------------------------------------------------------------- /doc/howtos/howto-1b-page#1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #1b: User clicks a link on a page we control and page is usable at some developer determined point 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #1b:
User clicks a link on a page we control and page is usable at some developer determined point

11 |

12 | See use case #1 for a description of this requirement. 13 |

14 |

15 | We use two pages for this use case. They may be any two pages on your site, and the code you put into them 16 | is identical, so you could just put it on all pages on your site. Unlike case 1a, in this case, we do not 17 | allow the beacon to fire when the onload event fires. Instead, we fire the page_ready event 18 | when we determine that the page is ready. We also set the autorun parameter to false to stop 19 | boomerang from running automatically. 20 |

21 |
    22 |
  1. Copy boomerang.js and the images/ directory into your document root
  2. 23 |
  3. Add the code below to all your pages. You may add it at any point before your page is considered complete.
  4. 24 |
25 |
26 | <script src="boomerang.js" type="text/javascript"></script>
27 | <script type="text/javascript">
28 | BOOMR.init({
29 | 		user_ip: "<user's ip address>",
30 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
31 | 		autorun: false
32 | 	});
33 | </script>
34 | 
35 |

36 | The rest of your page will load normally. When you determine (through javascript, perhaps) that your 37 | page is usable by a user browsing your website, you need to fire the page_ready event like this: 38 |

39 | 40 |
41 | BOOMR.page_ready();	// Tell boomerang that the page is now usable
42 | 
43 | 44 |

45 | As in howto-1a, you need to populate the user_ip field using a back end programming language. 46 |

47 | 48 |

49 | Go to Page #2 now to see the results of the page load test. 50 |

51 | 52 | 55 | 56 |

57 |

58 | 59 | 60 | 61 | 77 | 78 | 79 | 83 | -------------------------------------------------------------------------------- /doc/howtos/howto-1b-page#2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #1b: User clicks a link on a page we control and page is usable at some developer determined point 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #1b:
User clicks a link on a page we control and page is usable at some developer determined point

11 |

12 | See use case #1 for a description of this requirement. 13 |

14 |

15 | We use two pages for this use case. This is page #2 of the example. See Page #1 16 | for full explanation. 17 |

18 | 19 |

20 | If you clicked the link to this page from Page #1, you should see 21 | page performance results show up below. We introduce an artificial delay of 750ms to show how you can 22 | fire the page_ready event after the page has loaded. It may take a while if this is the 23 | first time you're doing the test since testing your bandwidth takes about 6 seconds. You can also click 24 | the link to Page #1 to see the same output on Page #1. 25 |

26 | 27 | 30 | 31 |

32 |

33 | 34 | 35 | 36 | 52 | 53 | 54 | 58 | -------------------------------------------------------------------------------- /doc/howtos/howto-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #2: Measure perceived performance of content loaded dynamically 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #2:
Measure perceived performance of content loaded dynamically

11 |

12 | See use case #2 for a description of this requirement. 13 |

14 |

15 | This document attempts to load some content using XHR and measures the time it took to load that 16 | content using boomerang. This is how you do it: 17 |

18 |
    19 |
  1. Copy boomerang.js and the images/ directory into your document root
  2. 20 |
  3. Add the code below to your page, somewhere before your XHR calls.
  4. 21 |
22 |
 23 | <script src="boomerang.js" type="text/javascript"></script>
 24 | <script type="text/javascript">
 25 | BOOMR.init({
 26 | 		user_ip: "<user's ip address>",
 27 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
 28 | 		auto_run: false
 29 | 	});
 30 | </script>
 31 | 
32 | 33 |

34 | Next fetch your content. Right before the call to fetch content, start the timer. The load time timer is called 35 | t_done. In the callback function where the content has been fetched, call the done() 36 | method. This measures and beacons back the response time. I use YUI 3 in the code below, but you could use 37 | anything you like. 38 |

39 | 40 |
 41 | YUI().use("io-base", function(Y) {
 42 |     var uri = "dynamic-content.txt";
 43 | 
 44 |     function complete(id, o) {
 45 |         var html = o.responseText;
 46 | 	document.getElementById("dynamic-content").innerHTML = html;
 47 | 	BOOMR.plugins.RT.done();	// Tell boomerang to measure time and fire a beacon
 48 |     };
 49 | 
 50 |     Y.on('io:complete', complete);
 51 | 
 52 |     BOOMR.plugins.RT.startTimer("t_done");	// Start measuring download time
 53 |     var request = Y.io(uri);
 54 | });
 55 |  
56 | 57 | 60 | 61 |

62 |

63 | 64 |
65 |
66 | 67 | 68 | 69 | 70 | 98 | 99 | 100 | 104 | -------------------------------------------------------------------------------- /doc/howtos/howto-3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #3: Measure a user's bandwidth/latency along with page load time 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #3:
Measure a user's bandwidth/latency along with page load time

11 |

12 | See use cases #3 & #5 for a description of this requirement. 13 |

14 | 15 |

16 | By default, boomerang always measures the user's bandwidth and HTTP latency and adds these numbers to the beacon 17 | that it sends back. In reality, the bandwidth plugin (BOOMR.plugins.BW) does this, but since that's 18 | bundled along with boomerang, the difference is purely academic. There are a few things you need to know in order 19 | to use the bandwidth detection code effectively. 20 |

21 | 22 |

23 | First, bandwidth detection through javascsript is not accurate. If the user's network is lossy or is shared with 24 | other users, or network traffic is bursty, real bandwidth can vary over time. The measurement we take is based 25 | over a short period of time, and this may not be representative of the best or worst cases. We try to cover for 26 | that by measuring not just the bandwidth, but also the error value in that measurement. 27 |

28 | 29 |

30 | Simply adding boomerang to a page and calling the init() method is sufficient to start the bandwidth 31 | test and beacon its results back to the server. This is the code you'd use: 32 |

33 |
 34 | <script src="boomerang.js" type="text/javascript"></script>
 35 | <script type="text/javascript">
 36 | BOOMR.init({
 37 | 	beacon_url: "http://yoursite.com/path/to/beacon.php",
 38 | 	BW: {
 39 | 		base_url: "http://base_url/to/bandwidth/images/"
 40 | 	}
 41 | });
 42 | </script>
 43 | 
44 |

45 | The default value of the BW.base_url parameter is images/, so if your bandwidth detection 46 | images are placed in a subdirectory of the current directory called images, then you do not need 47 | to set the BW.base_url parameter. It is a good practice though, as you might have pages in multiple 48 | directories. 49 |

50 | 51 |

52 | Now while this is the minimum code required to measure bandwidth and latency and have it beaconed back, it isn't 53 | the best option for your user. The test will run every time the user visits a page on your site even though 54 | their bandwidth probably hasn't changed (apart from regular fluctuations). It's far better to store the bandwidth 55 | in a cookie for a fixed period of time, and read it out of the cookie if it exists. Now it is possible that the 56 | user moves between several networks, eg: a laptop used at home, at work and at a coffee shop. The bandwidth and 57 | latency at these locations may be different, and it's necessary to measure them separately. We detect a change 58 | in network through the user's IP address, so in order to store the user's bandwidth in a cookie, you will need 59 | to tell boomerang what the user's IP address is. You do this through the user_ip parameter. 60 |

61 | 62 |
 63 | <script src="boomerang.js" type="text/javascript"></script>
 64 | <script type="text/javascript">
 65 | BOOMR.init({
 66 | 	beacon_url: "http://yoursite.com/path/to/beacon.php",
 67 | 	user_ip: "<user's ip>",
 68 | 	BW: {
 69 | 		base_url: "http://base_url/to/bandwidth/images/"
 70 | 	}
 71 | });
 72 | </script>
 73 | 
74 | 75 |

76 | As far as I know, there's no way in javascript to figure out the user's IP address. You'll have to do this server 77 | side and write the value into your code. 78 |

79 | 80 |

IPv4 optimisations

81 |

82 | If your user has an IPv4 address, then we also strip out the last part of the IP and use that rather than the entire 83 | IP address. This helps if users use DHCP on the same ISP where their IP address changes frequently, but they stay 84 | within the same subnet. If the user has an IPv6 address, we use the entire address. 85 |

86 | 87 |

The Cookie

88 |

89 | You may want to customise the name of the cookie where the bandwidth will be stored. By default this is 90 | set to BA, but you can change it using the BW.cookie parameter. 91 |

92 | 93 |
 94 | <script src="boomerang.js" type="text/javascript"></script>
 95 | <script type="text/javascript">
 96 | BOOMR.init({
 97 | 	beacon_url: "http://yoursite.com/path/to/beacon.php",
 98 | 	user_ip: "<user's ip>",
 99 | 	BW: {
100 | 		base_url: "http://base_url/to/bandwidth/images/",
101 | 		cookie: "BW"
102 | 	}
103 | });
104 | </script>
105 | 
106 | 107 |

108 | This cookie is set to expire in 7 days. You can change its lifetime using the BW.cookie_exp parameter. 109 | The value is in seconds. During that time, you can also read the value of the cookie on the server side. Its 110 | format is as follows: 111 |

112 | 113 |
114 | BA=ba=nnnnnnn&be=nnn.nn&l=nnnn&le=nn.nn&ip=iiiiii&t=sssssss;
115 | 
116 |

117 | The parameters are defined as: 118 |

119 |
120 |
ba
121 |
[integer] [bytes/s] The user's bandwidth to your server
122 |
be
123 |
[float] [bytes/s] The 95% confidence interval margin of error in measuring the user's bandwidth
124 |
l
125 |
[float] [ms] The HTTP latency between the user's computer and your server
126 |
le
127 |
[float] [ms] The 95% confidence interval margin of error in measuring the user's latency
128 |
ip
129 |
[ip address] The user's IPv4 or IPv6 address that was passed as the user_ip parameter to the init() method
130 |
t
131 |
[timestamp] The browser time (in seconds since the epoch) when the cookie was set
132 |
133 | 134 |

135 | These parameters are also sent in the beacon (See HOWTO #0), but having them in the 136 | cookie means that you can customise your users experience based on the bandwidth before you serve a request. 137 |

138 | 139 |

Disabling the bandwidth check

140 |

141 | Finally, there may be cases when you want to completely disable the bandwidth test. Perhaps you know that 142 | your user is on a slow network, or pays by the byte (the bandwidth test uses a lot of bandwidth), or is on 143 | a mobile device that cannot handle the load. In such cases you have two options. 144 |

145 |
    146 |
  1. Delete the bandwdith plugin from your copy of boomerang.js
  2. 147 |
  3. Set the BW.enabled parameter to false:
  4. 148 |
149 |
150 | <script src="boomerang.js" type="text/javascript"></script>
151 | <script type="text/javascript">
152 | BOOMR.init({
153 | 	BW: { enabled: false  }
154 | });
155 | </script>
156 | 
157 | 158 | 161 | 162 |

163 |

164 | 165 | 166 | 167 | 179 | 180 | 181 | 185 | -------------------------------------------------------------------------------- /doc/howtos/howto-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 22 | Boomerang Howto #4: Measure more than just page load time 23 | 24 | 25 | 29 | 30 | 31 | All Docs | Index 32 |

Boomerang Howto #4: Measure more than just page load time

33 |

34 | See use case #4 for a description of this requirement. 35 |

36 |

37 | Up until now we've measured the time it takes for a page to become usable by the user. It may also be 38 | useful to measure the time it took for various components within the page to load and match that up with 39 | the full page load time. boomerang provides additional timers that you can configure to measure separate 40 | parts of your page. You use the startTimer() and endTimer() methods of the 41 | roundtrip (BOOMR.plugin.RT) plugin to do this. 42 |

43 | 44 |

45 | In the following examples, you'll need to make sure that boomerang.js is loaded and the 46 | init() method called before you call any of these methods, so perhaps putting it at the 47 | top of your page is a good idea. We'll see later how to work around this. 48 |

49 | 50 |

51 | First, identify sections of your page that you want to measure. Call startTimer() before 52 | and endTimer() after. Each timer has its own name. The names are free-form strings, 53 | but stay simple to be efficient. Stick to alphanumeric characters and underscores, and limit names 54 | to around 5 characters, eg: t_ads, t_head, t_js. The following 55 | names are reserved: t_done, t_page, t_resp. 56 |

57 | 58 |

59 | Make sure you've included boomerang.js before starting the timers. 60 |

61 | 62 |
 63 | <html>
 64 |   <head>
 65 |     <script src="boomerang.js" type="text/javascript"></script>
 66 |     <script type="text/javascript">
 67 |       BOOMR.init({
 68 | 		beacon_url: "http://yoursite.com/path/to/beacon.php"
 69 |       });
 70 |       BOOMR.plugins.RT.startTimer("t_head");
 71 |     </script>
 72 |     <title>page title</title>
 73 |     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
 74 |     <link rel="stylesheet" type="text/css" href="../boomerang-docs.css">
 75 |     <script type="text/javascript">
 76 |       BOOMR.plugins.RT.endTimer("t_head").startTimer("t_body");
 77 |     </script>
 78 |   </head>
 79 |   <body>
 80 |     page body here
 81 |     <script type="text/javascript">
 82 |       BOOMR.plugins.RT.endTimer("t_body");
 83 |     </script>
 84 |   </body>
 85 | </html>
 86 | 
87 | 88 |

89 | Your timers will now be included in the beacon along with t_done. 90 |

91 | 92 |

93 | Notice in the second invocation how we chain the calls to endTimer and startTimer. 94 | This is possible for most methods that you call since they return a reference to the object. Note 95 | that the timer methods are run on the BOOMR.plugins.RT object, so they return a reference 96 | to that object and not to the BOOMR object. 97 |

98 | 99 |

Measuring time for content loaded before boomerang

100 |

101 | Now we've said for years that putting javascript at the bottom of your document is good for 102 | performance, so asking you to load boomerang at the top may not be the best advice. You can 103 | still measure in-page times though, and then report them to boomerang once it has loaded. 104 | You do this using the BOOMR.plugins.RT.setTimer() method. This method takes 105 | two parameters — the timer name and its value in milliseconds. The code above will 106 | change to this: 107 |

108 | 109 |
110 | <html>
111 |   <head>
112 |     <script type="text/javascript">
113 |       var t_pagestart=new Date().getTime();
114 |     </script>
115 |     <title>page title</title>
116 |     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
117 |     <script type="text/javascript">
118 |       var t_headend = new Date().getTime();
119 |     </script>
120 |   </head>
121 |   <body>
122 |     page body here
123 |     <script type="text/javascript">
124 |       var t_jsstart = new Date().getTime();
125 |     </script>
126 |     <script src="boomerang.js" type="text/javascript"></script>
127 |     <script type="text/javascript">
128 |       BOOMR.init({
129 | 		beacon_url: "http://yoursite.com/path/to/beacon.php"
130 |       });
131 |       var t_bodyend = new Date().getTime();                        
132 |       BOOMR.plugins.RT.setTimer("t_head", t_headend - t_pagestart).
133 |                        setTimer("t_body", t_bodyend - t_headend).  
134 |                        setTimer("t_js", t_bodyend - t_jsstart);    
135 |     </script>
136 |   </body>
137 | </html>
138 | 
139 | 140 | 143 | 144 |

145 |

146 | 149 | 150 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /doc/howtos/howto-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #5: Request/page tagging 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #5: Request/page tagging

11 |

12 | See use case #5 for a description of this requirement. 13 |

14 |

15 | There will be several occassions when you need to add more information to the beacon that's sent 16 | back to the server. For example, you may want to tag the beacon with a page_id or 17 | you may want to do A/B testing and tag the beacon with a parameter specifying which bucket this 18 | beacon is for. You can achieve all this using the BOOMR.addVar() method. 19 |

20 | 21 |

22 | Before you use this method, remember that each plugin adds its own parameters and you shouldn't 23 | overwrite these with your own values. See Howto #0 for a list of 24 | parameters set by boomerang's built-in plugins. Other plugins may add their own parameters, 25 | consult the documentation of the plugin to find out what these are. 26 |

27 | 28 |
 29 | BOOMR.addVar("page_id", 123);
 30 | 
31 | 32 |

33 | The parameter name must be a string. We recommend only using alphanumeric characters and underscores, 34 | but you can really use anything you like. Parameter values may only be numbers or strings, ie, 35 | something that you can put into a URL. 36 |

37 | 38 |

39 | If you need to set multiple parameters, you can pass in an object instead: 40 |

41 | 42 |
 43 | BOOMR.addVar({
 44 | 		"bucket": "test#1",
 45 | 		"page_id": 123
 46 | 	});
 47 | 
48 | 49 |

50 | Make sure you've included boomerang.js before calling BOOMR.addVar(). 51 |

52 | 53 |

The beacon

54 |

55 | The beacon will include all variables that you add in the URL. Both keys and values will be 56 | URI encoded. Your back end application will need to understand the passed in parameters. 57 |

58 | 59 |
 60 | http://yoursite.com/path/to/beacon.php?bucket=test%231&page_id=123&t_done=.....
 61 | 
62 | 63 |

Removing variables

64 |

65 | You can also remove a parameter that you've added (or that a plugin has added) from the beacon. 66 | To do this, call the BOOMR.removeVar() method. This method takes in a list of 67 | name, and removes all of them from the parameter list. Any name that isn't in the parameter 68 | list is ignored. 69 |

70 | 71 |
 72 | // don't send the stooges to the server   
 73 | BOOMR.removeVar("larry", "moe", "curly");
 74 | 
75 | 76 |

Stopping the beacon

77 |

78 | You can also this as a crude way to prevent the beacon from firing. Inside your before_beacon 79 | event handler, simply remove all parameters. 80 |

81 | 82 |
 83 | BOOMR.subscribe('before_beacon', function(o) {
 84 | 	var p_names = [], k;
 85 | 
 86 | 	if( "t_done" in o ) {
 87 | 		return;
 88 | 	}
 89 | 
 90 | 	// t_done is not set, so don't beacon         
 91 | 	for(k in o) {
 92 | 		if(o.hasOwnProperty(k)) {
 93 | 			p_names.push(k);
 94 | 		}
 95 | 	}
 96 | 
 97 | 	// removeVar accepts either a list or an array
 98 | 	BOOMR.removeVar(p_names);
 99 | });
100 | 
101 | 102 | 105 | 106 |

107 |

108 | 109 | 110 | 126 | 127 | 128 | -------------------------------------------------------------------------------- /doc/howtos/howto-7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #7: Protecting the beacon from abuse 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #7: Protecting the beacon from abuse

11 |

12 | See use case #9 for a description of this requirement. 13 |

14 | 15 |

16 | There are two types of beacon abuse you may need to protect against: 17 |

18 |
    19 |
  1. Denial of service attacks
  2. 20 |
  3. Fake beacons that do not originate from a page you own
  4. 21 |
22 | 23 |

Denial of service

24 |

25 | There's nothing you can do in javascript to prevent denial of service attacks, but you can configure 26 | your server to rate limit beacons originating from a single IP. You typically shouldn't be receiving 27 | beacons faster than a user can open websites. You'll also want to do some operating system/web server 28 | level configurations to detect abusive access patterns. The majority of these are beyond the scope of 29 | this document, but we have a few tips on building your beaconing back end to protect you from an attack. 30 |

31 | 32 |

33 | Most developers will create a back end script that they use as the beacon_url parameter 34 | of boomerang. The problem here is that since these requests cannot be cached, this script will run 35 | on every beacon request, and will consume web server resources, and probably database resources on 36 | every request. During a denial of service attack, this can bring your servers down. 37 |

38 | 39 |

40 | A better way to handle it is to have a lightweight web server running on your beaconing server, and 41 | have this server configured to only respond to requests for the beacon URL. It should send back a 42 | HTTP 204 response to all beacon requests. This is easy enough to configure within the 43 | server and means that it doesn't have to do a disk lookup for any request. The server will still 44 | write the request to its access logs, and this should include all query string parameters and cookies. 45 |

46 | 47 |

48 | Periodically - say once an hour or once a day (depending on the volume of beacons), you can batch process 49 | your logs and figure out your actual beacon parameters from there, discarding any obviously fake or 50 | abusive beacons. The actual code to extract data from a beacon is the same regardless of whether you 51 | do it on every request or as a batch. See Howto #0 for more information 52 | on extracting data from a beacon. 53 |

54 | 55 |

56 | There's much 57 | more 58 | information online about DoS attacks 59 | and how to protect yourself from them. 60 |

61 | 62 |

Fake beacons that do not originate from a page you own

63 |

64 | The most common reason for this kind of abuse is that someone really liked your page design and copied 65 | it to their own server, including the boomerang javascript, only they didn't update the beacon_url, 66 | so it still beacons to your server. You probably don't want this. 67 |

68 | 69 |

70 | The easiest way to fix this is to just check the referrer of all requests and block any that don't 71 | come from your own domain. This works for the clueless abuser case, but not for the intentional 72 | abuser. 73 |

74 | 75 |

76 | The intentional abuser is someone who will try to exploit all URLs to your site just to see if they 77 | can get something out of it. What they try isn't really important. There's only one legitimate way 78 | of using your beacon, and you should block all other uses. The best way to do this is through a 79 | nonce or a 80 | crumb. 81 | This is a string that is valid for one use only. It probably includes the current timestamp and a 82 | validity period as part of its hash. You generate it on every page requests and add it to boomerang 83 | using the BOOMR.addVar() method. On your beacon server, you then validate the nonce 84 | before accepting the beacon. If you're batch processing, you'd use the timestamp of the request and 85 | not the time that you're running the batch job in order to validate the nonce. 86 |

87 | 88 |
 89 | BOOMR.addVar("nonce", "125a7b79de989876cce970f0768a07");	// your nonce will be different
 90 | 
91 | 92 |

93 | While the nonce can protect you from someone hitting your beacon URL directly, it does mean that your 94 | main page cannot be cached, since the nonce will change on every request. 95 |

96 | 97 |

98 | The nonce also doesn't protect you from someone pulling the beacon out of your page — with a valid 99 | nonce, then modifying the beacon parameters and sending it off to your server. Protecting against this 100 | requires you to sign the parameters in the beacon, but this isn't something that you can do in javascript. 101 | I do not know of a general purpose solution to this problem. 102 |

103 | 104 | 107 | 108 |

109 |

110 | 111 | 112 | 113 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /doc/howtos/howto-8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #8: Measure a user's DNS latency 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #8: Measure a user's DNS latency

11 |

12 | See use case #7 for a description of this requirement. 13 |

14 |

15 | Note: The DNS plugin hasn't been tested. Your help in testing it is appreciated. 16 |

17 |

18 | Measuring DNS requires some server-side set up. The entire set up was 19 | documented in detail 20 | by Yahoo! engineer Carlos Bueno, so go read his post for everything you'll need to set 21 | this up. In brief, the points he covers are: 22 |

23 |
    24 |
  1. Set up a wildcard hostname, perferably one that does not share cookies with your main site. 25 | Give it a low TTL, say, 60 seconds, so you don't pollute downstream caches.
  2. 26 |
  3. Set up a webserver for the wildcard hostname that serves the images named A.gif 27 | and B.gif (from the images/ subdirectory) as fast as possible. 28 | Make sure that KeepAlive, Nagle, and any caching headers are turned off.
  4. 29 |
  5. Include dns.js along with boomerang.js (you can just concatenate the two 30 | files)
  6. 31 |
  7. Tell the DNS plugin where to get its images from
  8. 32 |
33 | 34 |

35 | Steps 1 and 2 are complicated, and if you don't have full control over your DNS server (eg: you use 36 | Dreamhost), then it may be impossible for you to do this. If you can go forward, read on. 37 |

38 | 39 |

40 | To configure the plugin, you only need to tell it where to get its images from. Unlike the bandwidth 41 | plugin though, this URL needs a wildcard: 42 |

43 |
44 | <script src="boomerang.js" type="text/javascript"></script>
45 | <script src="dns.js" type="text/javascript"></script> <!-- concatenate with boomerang.js for better performance -->
46 | <script type="text/javascript">
47 | BOOMR.init({
48 | 		user_ip: "<user's ip address>",
49 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
50 | 		DNS: {                                         
51 | 		    base_url: "http://*.yoursite.com/images/"  
52 | 		}                                              
53 | 	});
54 | </script>
55 | 
56 | 57 |

58 | If you've set things up correctly, this should measure your DNS latency within a margin of error. 59 | We could run the test multiple times to find out what this error is, but for now we'll just do 60 | it once. 61 |

62 | 63 | 66 | 67 |

68 |

69 | 70 | 71 | 72 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /doc/howtos/howto-9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang Howto #9: Collect performance data from the W3C Navigation Timing API 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang Howto #9: Collect performance data from the Navigation Timing API

11 | 12 |

The W3C Navigation Timing API is an interface implemented by modern browsers that 13 | provides broad and deep data related to the performance of page loads. At the time 14 | of this writing, it is supported by the following browsers:

15 | 16 | 21 | 22 |

The navtiming.js plugin doesn't require any configuration options as it simply 23 | reads data out of the browser (if available) and adds it to the beacon query 24 | string.

25 | 26 |

You will have to build your own version of boomerang.js since it 27 | isn't one of the default plugins. To do this, run make in the 28 | boomerang directory with the following option:

29 | 30 |
31 | make PLUGINS=navtiming.js
32 | 
33 | 34 |

Then you can include the new boomerang file (don't forget to run it through 35 | your favorite Javascript minifier first) as you normally would.

36 | 37 |

The new query parameters and the browser attributes they map 38 | to are shown below. More information about the definition of each attribute can be found 39 | in the W3C Navigation Timing specification.

40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 |
Boomerang beacon parameterNavigation Timing attribute
nt_red_cntwindow.performance.navigation.redirectCount
nt_nav_typewindow.performance.navigation.type
nt_nav_stwindow.performance.timing.navigationStart
nt_red_stwindow.performance.timing.redirectStart
nt_red_endwindow.performance.timing.redirectEnd
nt_fet_stwindow.performance.timing.fetchStart
nt_dns_stwindow.performance.timing.domainLookupStart
nt_dns_endwindow.performance.timing.domainLookupEnd
nt_con_stwindow.performance.timing.connectStart
nt_con_endwindow.performance.timing.connectEnd
nt_req_stwindow.performance.timing.requestStart
nt_res_stwindow.performance.timing.responseStart
nt_res_endwindow.performance.timing.responseEnd
nt_domloadingwindow.performance.timing.domLoading
nt_domintwindow.performance.timing.domInteractive
nt_domcontloaded_stwindow.performance.timing.domContentLoadedStart
nt_domcontloaded_endwindow.performance.timing.domContentLoadedEnd
nt_domcompwindow.performance.timing.domComplete
nt_load_stwindow.performance.timing.loadEventStart
nt_load_endwindow.performance.timing.loadEventEnd
nt_unload_stwindow.performance.timing.unloadEventStart
nt_unload_endwindow.performance.timing.unloadEventEnd
69 | 70 | 73 | 74 |

75 |

76 | 77 | 78 | 79 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /doc/howtos/howtos.js: -------------------------------------------------------------------------------- 1 | // Since we don't set a beacon_url, we'll just subscribe to the before_beacon function 2 | // and print the results into the browser itself. 3 | BOOMR.subscribe('before_beacon', function(o) { 4 | var html = "", t_name, t_other, others = []; 5 | 6 | if(!o.t_other) o.t_other = ""; 7 | 8 | for(var k in o) { 9 | if(!k.match(/^(t_done|t_other|bw|lat|bw_err|lat_err|u|r2?)$/)) { 10 | if(k.match(/^t_/)) { 11 | o.t_other += "," + k + "|" + o[k]; 12 | } 13 | else { 14 | others.push(k + " = " + o[k]); 15 | } 16 | } 17 | } 18 | 19 | if(o.t_done) { html += "This page took " + o.t_done + " ms to load
"; } 20 | if(o.t_other) { 21 | t_other = o.t_other.replace(/^,/, '').replace(/\|/g, ' = ').split(','); 22 | html += "Other timers measured:
"; 23 | for(var i=0; i"; 25 | } 26 | } 27 | if(o.bw) { html += "Your bandwidth to this server is " + parseInt(o.bw*8/1024) + "kbps (±" + parseInt(o.bw_err*100/o.bw) + "%)
"; } 28 | if(o.lat) { html += "Your latency to this server is " + parseInt(o.lat) + "±" + o.lat_err + "ms
"; } 29 | 30 | var r = document.getElementById('results'); 31 | r.innerHTML = html; 32 | 33 | if(others.length) { 34 | r.innerHTML += "Other parameters:
"; 35 | 36 | for(var i=0; i 2 | 3 | 4 | 5 | List of Howto docs 6 | 7 | 8 | 9 | All Docs 10 |

How to do stuff with boomerang

11 |

12 | The following is a list of all items identified in the use case document and then some. 13 |

14 |

HOWTO

15 | 29 | 30 |

TODO

31 | 34 | 35 | 38 | 39 | 40 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /doc/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | this, is boomerang 6 | 7 | 8 | 9 | 日本語 10 |

this, is boomerang

11 |

12 | boomerang always comes back, except when it hits something. 13 |

14 |

what?

15 |

16 | boomerang is a piece of javascript that you add to your web pages, where it measures 17 | the performance of your website from your end user's point of view. It has the ability 18 | to send this data back to your server for further analysis. With boomerang, you find 19 | out exactly how fast your users think your site is. 20 |

21 |

22 | boomerang is opensource and released under the BSD license, 23 | and we have a whole bunch of documentation about it. 24 |

25 |

how?

26 | 35 |

who?

36 |

37 | boomerang comes to you from the Exceptional Performance 38 | team at Yahoo!, aided by the Yahoo! 39 | Developer Network. 40 |

41 |

where?

42 | 46 | 47 | 48 | 49 | 53 | -------------------------------------------------------------------------------- /doc/ja/TODO.txt: -------------------------------------------------------------------------------- 1 | 1. Add random sampling 2 | This needs to be a little intelligent because plugins may have different 3 | criteria for sampling. For example, the RT plugin requires two pages -- 4 | one for tstart and one for tend. Since tstart is a relatively inexpensive 5 | operation, it makes sense for us to set tstart on all pages, but only set 6 | tend based on the random sample. 7 | 8 | 2. Measure time from page start to page_load 9 | Since we may not always have control over the exact moment the user 10 | initiated a request for our page, the next best thing would be to measure 11 | the time from the first byte to reach the user to the time the page loaded. 12 | 13 | Note that comparing with server time is not a good idea since the user's 14 | system clock may not actually be correct. 15 | 16 | See use-case #1c & #1d. 17 | 18 | 3. Rewrite bandwidth testing code to be pretty and clean 19 | 20 | 4. Create a yui-gallery module 21 | -------------------------------------------------------------------------------- /doc/ja/api/BOOMR.utils.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | BOOMR ユーティリティ関数 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | API 10 |

BOOMR ユーティリティ関数

11 |

12 | 全てのユーティリティ関数は名前空間 BOOMR.utils のもとに定義されています。以降のメソッドにアクセスするには BOOMR.utils オブジェクトを参照してください。例: getCookie() メソッドを呼び出すには BOOMR.utils.getCookie() を使用します。 13 |

14 | 15 |

メソッド

16 | 17 |
18 | 19 |
getCookie(sName)
20 |
21 |

22 | sName をキーとした Cookie の値を取得します。 23 |

24 |

返り値

25 |
    26 |
  • sName に結びつく Cookie の文字列。空の文字列の場合もあります。
  • 27 |
  • Cookie が見つからないか sName が空だった場合は null を返します。
  • 28 |
29 |
30 | 31 |
setCookie(sName, oSubCookies, nMaxAge, sPath, sDomain, bSecure)
32 |
33 |

34 | シリアライズ化された oSubCookies の値に sName の名前をつけて Cookie をセットします。 35 |

36 |

パラメーター:

37 |
38 | 39 |
sName
40 |
Cookie の名前
41 | 42 |
oSubCookies
43 |
key/value ペアの Cookie に書き込むデータ。これらは URL エンコードした key=value ペアのリストを & で連結されてシリアライズ化されます。
44 | 45 |
nMaxAge
46 |
Cookie の有効時間(秒)。ブラウザーが閉じるまで有効にする場合は 0 をセットします。デフォルトは 0 です。
47 | 48 |
sPath
49 |
Cookie が有効となる HTTP のパス。Cookie はこのドメイン上の sPath 以下の全ての URL へ送信されます。セットしていない場合は現在のドキュメントのパスがデフォルトになります。あなたがサーバー上で同じドメインを複数のユーザーと共有している限り、/(スラッシュ)をセットすることになるでしょう。
50 | 51 |
sDomain
52 |
Cookie が有効となる HTTP ドメイン。Cookie はこのドメインのサブドメイン上の全ての URL へ送信されます。セットしていない場合は現在のドキュメントのドメインがデフォルトになります。もし null をセットした場合、BOOMR.init() が呼び出されて設定された site_domain の値が使用されます。大抵の場合 null をセットすることになるでしょう。 53 |
54 | 55 |
bSecure
56 |
もし true がセットされると、Cookie は HTTPS の URL だけに送信します。false がセットされているか、またはセットされていない場合は Cookie は上記のルールに沿った全ての URL へ送信されます。あなたのサイトが完全な SSL ベースでない限りこの設定は無視できます。
57 |
58 | 59 |

60 | 全体の名前と値が4000文字未満である必要があることを注意してください。 61 |

62 | 63 |

例:

64 |

65 | BOOMR.plugins.RT プラグインはこの関数をこのようにして使います: 66 |

67 |
 68 | if(!BOOMR.utils.setCookie(
 69 | 			impl.cookie,
 70 | 			{ s: t_start, r: url },
 71 | 			impl.cookie_exp,
 72 | 			"/",
 73 | 			null
 74 | 		)) {
 75 | 	BOOMR.error("cannot set start cookie", "rt");
 76 | 	return this;
 77 | }
 78 | 
79 | 80 |

返り値

81 |
    82 |
  • Cookie のセットに成功した場合は true を返します
  • 83 |
  • Cookie のセットに失敗した場合は false を返します
  • 84 |
85 |
86 | 87 |
getSubCookies(sCookie)
88 |
89 |

90 | getCookie() によって取得した Cookie の文字列をパースし、サブ Cookie とした構成で切り分けます。 91 |

92 |

例:

93 |

94 | BOOMR.plugins.BW プラグインはこの関数をこのようにして使います: 95 |

96 |
 97 | var cookies = BOOMR.utils.getSubCookies(BOOMR.utils.getCookie(impl.cookie));
 98 | 
99 |

返り値

100 |
    101 |
  • 成功すると全てのサブ Cookie が key/value のペアとなったオブジェクトを返します。サブ Cookie の値が空の場合もあることに注意してください。
  • 102 |
  • sCookie がセットされていないか有効なサブ Cookie が含まれていない場合は null を返します。
  • 103 |
104 |
105 | 106 |
removeCookie(sName)
107 |
108 |

109 | sName にセットされた値を無効化して Cookie を削除し、セッション Cookie をつくります。 110 |

111 |

返り値

112 |

113 | なし 114 |

115 |
116 | 117 |
pluginConfig(oImpl, oConfig, sName, aProperties)
118 |
119 |

120 | init() メソッドに渡された設定オブジェクトと一緒に設定するためにプラグインが呼び出せる便利なメソッドです。 121 |

122 |

パラメーター:

123 |
124 |
oImpl
125 |
全ての設定とプライベートのプロパティを格納したプラグインの impl オブジェクト。
126 | 127 |
oConfig
128 |
プラグインの init() メソッドに渡された設定オブジェクト。
129 | 130 |
sName
131 |
BOOMR.plugins オブジェクト内でのプラグインの名前。
132 | 133 |
aProperties
134 |
プラグインが設定できる全てのプロパティを含んだ配列。
135 |
136 | 137 |

例:

138 |

139 | BOOMR.plugins.RT プラグインはこのメソッドをこのようにして使います: 140 |

141 |
142 | BOOMR.utils.pluginConfig(impl, config, "RT", ["cookie", "cookie_exp", "strict_referrer"]);
143 | 
144 | 145 |

返り値

146 |
    147 |
  • 最低ひとつのプロパティがセットされれば true を返します。
  • 148 |
  • プロパティがセットされていないか oConfig オブジェクトがセットされていなければ false を返します。
  • 149 |
150 |
151 | 152 |
153 | 154 | 157 | 158 | 159 | 160 | 164 | -------------------------------------------------------------------------------- /doc/ja/api/BW.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 帯域幅/遅延 プラグイン API 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | API 10 |

帯域幅/遅延 プラグイン API

11 |

12 | 帯域幅プラグインはサーバーへのユーザーのネットワークコネクションの帯域幅と遅延を測定します。帯域幅 API は BOOMR.plugins.BW に内包されます。 13 |

14 | 15 |

Configuration

16 |

17 | bandwidth プラグインの全ての設定は BW の名前空間の下に入ります。設定オブジェクトについては 使用方法 #6 — boomerang の設定 をご覧ください。 18 |

19 |
20 |
base_url
21 |
22 | [推奨] 23 | 初期値では、bandwidth プラグインは帯域幅測定用の画像を現在のページのディレクトリーの images/ サブディレクトリーから見つけます。これはあなたのサイト上の全てのページで正しいとは限りません。画像があるディレクトリーのパスを base_url パラメーターで設定ができます。絶対 URL または相対 URL で指定ができます。相対パスの場合、JavaScript ファイルからではなく boomerang が読み込まれたページからの相対パスになることを覚えておいてください。 24 |
25 | 26 |
cookie
27 |
28 | [オプション] 29 | ユーザーのコネクションの帯域幅と遅延の測定結果を格納する Cookie の名前。初期値は BA です。詳細は 使用方法 #3 をご覧ください。Cookie を無視して開始時間を完全に WebTiming API に依存させるには、ここに null のような偽の値か空文字を指定します。 30 |
31 | 32 |
cookie_exp
33 |
34 | [オプション] 35 | 秒で表した Cookie の有効期限。初期値は7日間です。これはユーザーの帯域幅テストを再度行うまでにどれくらい空けるかを記述します。IP アドレスをもとにその間は変更されません。ネットワークコネクションの帯域幅は通常は定期的に大きくは変わらないため、実際はこの設定を何も変更する必要はありません。
36 | もしあなたがレアルタイムストリーミングのようなことを行っている場合、帯域幅のテストは適切ではなく、Cookie に短い値を設定するのは正しい方法ではありません。 37 |
38 | 39 |
timeout
40 |
41 | [オプション] 42 | ミリ秒で表した帯域幅のテスト全体のタイムアウト値。初期値は15秒です。帯域幅のテストは長時間実行できるため、時々ネットワークエラーが発生し終了しないかもしれません。タイムアウトは強制的にテストを終了させます。これはハードリミットです。もしタイムアウトになると、テストの続行を停止してこの時点で取得できているデータから帯域幅を計算しようとします。タイムアウトを長くすればさらに多くのデータを取得し精度を向上できますが、長くした分、ユーザーがページを離れる前にテストが終了しないリスクも増えます。 43 |
44 | 45 |
nruns
46 |
47 | [オプション] 48 | 帯域幅のテストを実行する回数。初期値は5回です。初回のテストは常に残りのテストを続行するためにベストな計算をするための試験的なものです。この回数が増えるとテストの精度も向上していきますが、増やした分、テストがタイムアウトするリスクも増えます。これは実行毎に約2秒から4秒かかるため、この値は timeout の値よりも超えるように考慮しなければなりません。 49 |
50 | 51 |
52 | 53 | 54 |

メソッド

55 | 56 |
57 | 58 |
init(oConfig)
59 |
60 |

61 | 帯域幅プラグインを設定するために BOOMR.init() メソッドによって呼び出されます。 62 |

63 |

パラメーター

64 |
65 |
oConfig
66 |
BOOMR.init() を通して渡された設定オブジェクト。詳しくは 設定項目の説明 をご覧ください。 67 |
68 |

返り値

69 |

70 | BOOMR.plugins.BW オブジェクトへの参照。メソッドチェーンをサポートします。 71 |

72 |
73 | 74 |
run()
75 |
76 |

77 | 帯域幅テストを開始します。 78 | このメソッドは page_ready イベントが発生したときに自動的に呼び出されます。もし必要であれば自分で呼び出してもかまいません。 79 |

80 |

返り値

81 |

82 | BOOMR.plugins.BW オブジェクトへの参照。メソッドチェーンをサポートします。 83 |

84 |
85 | 86 |
abort()
87 |
88 |

89 | すぐに帯域幅のテストを中断して、すでに収集した値から帯域幅と遅延を計算します。このメソッドは帯域幅のテストが中断されると自動的に呼び出されます。BOOMR.init() メソッドを呼び出すときに適切な timeout 値を設定することを推奨します。 90 |

91 |

返り値

92 |

93 | BOOMR.plugins.BW オブジェクトへの参照。メソッドチェーンをサポートします。 94 |

95 |
96 | 97 |
is_complete()
98 |
99 |

100 | 帯域幅プラグインが終了したのかどうかを確認するために BOOMR.sendBeacon() によって呼び出されます。 101 |

102 |

返り値

103 |
    104 |
  • プラグインが終了している場合は true を返します。
  • 105 |
  • プラグインが終了していない場合は false を返します。
  • 106 |
107 |
108 | 109 |
110 | 111 |

ビーコンパラメーター

112 |

113 | このプラグインはビーコンに次のパラメーターを追加します: 114 |

115 |
116 |
bw
秒間のバイト数にしたユーザーの測定された帯域幅
117 |
bw_err
測定したユーザーの帯域幅でエラーを除いた95%信頼できる値
118 |
lat
ミリ秒にしたユーザーの HTTP 遅延
119 |
lat_err
測定したユーザーの HTTP 遅延でエラーを除いた95%信頼できる値
120 |
bw_time
帯域幅と遅延を測定したときのユーザーのブラウザーのタイムスタンプ
121 |
122 | 123 | 124 | 127 | 128 | 129 | 130 | 134 | -------------------------------------------------------------------------------- /doc/ja/api/DNS.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DNS 遅延プラグイン API 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | API 10 |

DNS 遅延プラグイン API

11 |

12 | 注意: この DNS プラグインはまだテストされていません。テストに協力してくれる方を歓迎します。 13 |

14 |

15 | DNS プラグインはブラウザーからサーバーへの DNS ルックアップの遅延を測定します。 DNS API は BOOMR.plugins.DNS に内包されます。 16 |

17 | 18 |

19 | 注意: この DNS プラグインはいくつかのサーバー側の準備が必要になります。詳しくは 使用方法 #8 をご覧ください。 20 |

21 | 22 |

メソッド

23 | 24 |
25 | 26 |
init(oConfig)
27 |
28 |

29 | DNS プラグインを設定するために BOOMR.init() メソッドによって呼び出されます。これは1つのオプションだけ設定できます: 30 |

31 |
32 |
base_url
33 |
34 | [必須] 35 | base_url パラメーターは DNS のテスト画像がどこにあるかを指定します。この URL にはランダムな文字列に置き換えられるワイルドカードを含まれている必要があります。画像は他の変更はせずにこの文字列に追加されます。もし HTTPS のページの場合は、この URL も同様に HTTP と HTTPS 上で動作するように設定する必要があります。URL のプロトコル部分は現在のドキュメントに合わせて自動的に変わります。 36 |
37 |
38 |
39 | BOOMR.init({
40 | 		DNS: {                                                  
41 | 		            base_url: "http://*.yoursite.com/images/"   
42 | 		}                                                       
43 | 	});
44 | 
45 |

46 | 上の例では * がランダムな文字列に置き換えられます。 47 |

48 | 49 |

返り値

50 |

51 | BOOMR.plugins.DNS オブジェクトへの参照。メソッドチェーンをサポートします。 52 |

53 |

注意

54 |

55 | base_url が設定されていなければ DNS テストは実行されません。 56 |

57 |
58 | 59 |
is_complete()
60 |
61 |

62 | DNS プラグインが終了したのかどうかを確認するために BOOMR.sendBeacon() によって呼び出されます。 63 |

64 |

返り値

65 |
    66 |
  • プラグインが終了している場合は true を返します。
  • 67 |
  • プラグインが終了していない場合は false を返します。
  • 68 |
69 |
70 | 71 |
72 | 73 |

ビーコンパラメーター

74 |

75 | このプラグインはビーコンに次のパラメーターを追加します: 76 |

77 |
78 |
dns
79 |
ユーザーのブラウザーから DNS サーバーまでの最も遅い DNS 遅延。
80 |
81 | 82 | 85 | 86 | 87 | 88 | 92 | -------------------------------------------------------------------------------- /doc/ja/api/RT.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Roundtrip プラグイン API 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | API 10 |

Roundtrip プラグイン API

11 |

12 | roundtrip プラグインはページの読み込み時間を測定したりページにタイマーを連動させたりします。この API は BOOMR.plugins.RT に内包されます。 13 |

14 | 15 |

Configuration

16 | 17 |

18 | roundtrip プラグインの全ての設定は RT の名前空間の下に入ります。設定オブジェクトについては 使用方法 #6 — boomerang の設定 に記載しています。 19 |

20 |
21 | 22 |
cookie
23 |
24 | [オプション] 25 | ページの読み込み時間を測定するための開始時間を格納する Cookie の名前。初期値は RT になります。 26 |
27 | 28 |
cookie_exp
29 |
30 | [オプション] 31 | 秒で表した Cookie の有効期間。これは1つのページの読み込みに負荷がかかるためできるだけ長くする必要があります。10秒以上にすればほとんどの場合は問題ありませんが、念のため遅いコネクションのユーザーをカバーするためや、地理的に遠いユーザーのために、数分は維持します。初期値は10分です。 32 |
33 | 34 |
strict_referrer
35 |
36 | [オプション] 37 | 初期値では boomerang は現在のページの document.referrerRT Cookie が一致しなければページの往復時間は測定しません。これは RT Cookie がまだ有効な状態で3番目のページを訪れたからということを意味し、ページの読み込み時間は無効となる可能性があります。
38 | このようなこともあるかもしれませんが、こういった場合は有効です — 例えば、SSL のページ間でリファラーが渡されません。この場合は、strict_referrerfalse にすればいいでしょう。 39 |
40 | 41 |
42 | 43 | 44 |

メソッド

45 | 46 |
47 | 48 |
init(oConfig)
49 |
50 |

51 | roundtrip プラグインを設定するために呼び出される BOOMR.init() メソッドです。 52 |

53 |

パラメーター

54 |
55 |
oConfig
56 |
BOOMR.init() を通して渡された設定オブジェクト。詳しくは 設定項目の説明 をご覧ください。 57 |
58 |

返り値

59 |

60 | BOOMR.plugins.RT オブジェクトへの参照。メソッドチェーンをサポートします。 61 |

62 |
63 | 64 |
startTimer(sName, [nValue])
65 |
66 |

67 | sName に指定された名前のタイマーを開始します。タイマーはミリ秒でカウントされます。boomerang のビーコンの測定結果を記録を終えるには endTimer() を呼び出す必要があります。 68 |

69 |

オプションとなる2番目のパラメーターである nValue はタイマーの開始時間とするタイムスタンプをミリ秒で指定します。これは boomerang が読み込まれる前にタイマーを開始する必要がある場合に便利です。

70 |

パラメーター:

71 |
72 |
sName
73 |
開始するタイマーの名前
74 | 75 |
nValue
76 |
[オプション] 77 | JavaScript のタイムスタンプ値(特定のミリ秒)。指定されている場合、タイマーの開始時間が明示的に設定されます。指定されていない場合は現在のタイムスタンプ値が使用されます。boomerang が読み込まれる前のタイムスタンプ値を測定する場合はこのパラメーターを Roundtrip プラグインに渡す必要があります。 78 |
79 |
80 |

例:

81 |

82 | startTimeer と endTimer の使用例は 使用方法 #4 をご覧くさい。 83 |

84 |

返り値

85 |

86 | BOOMR.plugins.RT オブジェクトへの参照。メソッドチェーンをサポートします。 87 |

88 |

注意

89 |

90 | startTimer("t_page") を呼び出すと endTimer("t_resp") を呼び出す副作用があります。これらのタイマーは通常(できるだけ近い)読み込んだ最初の byte から onloadt_page)までと onbeforeunload から最初の byte の時間(t_resp)を使います。明示的に startTimer("t_resp") を呼び出す必要はありません。 91 |

92 |
93 | 94 |
endTimer(sName, nValue)
95 |
96 |

97 | sName に指定された名前のタイマーを停止します。endTimer() が呼び出される前にタイマーが開始している必要はありません。この名前のタイマーが開始していない場合、前のページの unload 時間を代わりに使用します。これはページ間の時間の測定を可能にします。 98 |

99 |

パラメーター:

100 |
101 |
sName
102 |
停止するタイマーの名前
103 | 104 |
nValue
105 |
[オプション] 106 | JavaScript のタイムスタンプ値(特定のミリ秒)。セットされていればこの値の時間にタイマーが停止します。セットされていなければ現在の時間のタイムスタンプが使用されます。boomerang が読み込まれる前のタイムスタンプを測定し、roundtrip プラグインにその値を今すぐ渡す必要がある場合はこのパラメーターを使用します。 107 |
108 |
109 |

例:

110 |

111 | startTimeer と endTimer の使用例は 使用方法 #4 をご覧くさい。 112 |

113 |

返り値

114 |

115 | BOOMR.plugins.RT オブジェクトへの参照。メソッドチェーンをサポートします。 116 |

117 |
118 | 119 |
setTimer(sName, nValue)
120 |
121 |

122 | 明示的な時間を測定するために sName に指定された名前のタイマーをセットします。 123 | boomerang が読み込まれる前にページ内の時間を計測していて、それらの値をビーコンに含めるために roundtrip プラグインへ渡す必要がある場合はこのメソッドを使う必要があります。setTimer() を呼び出す前に startTimer()endTimer() を呼び出す必要はありません。もしそうした場合、古い値は無視され関数に渡された値が使用されます。 124 |

125 |

パラメーター:

126 |
127 |
sName
128 |
セットするタイマーの名前
129 | 130 |
nValue
131 |
132 | このタイマーをセットする時間(ミリ秒) 133 |
134 |
135 | 136 |

返り値

137 |

138 | BOOMR.plugins.RT オブジェクトへの参照。メソッドチェーンをサポートします。 139 |

140 |
141 | 142 |
done()
143 |
144 |

145 | 通常は boomerang の page_ready イベントが発生した時に自動的に呼び出されますが、onload イベントとは関係ない状態の読み込み時間を測定するために明示的に呼び出すこともできます。 146 |

147 |

148 | このメソッドはページの読み込み時間を計算し、ビーコンを送信する十分な値かどうかを判断します。その時に sendBeacon メソッドを通してBOOMR オブジェクトに知らせます。 149 |

150 | 151 |

例:

152 |

153 | done() メソッドの明示的な呼び出し方の例は 使用方法 #2 をご覧ください。 154 |

155 | 156 |

返り値

157 |

158 | BOOMR.plugins.RT オブジェクトへの参照。メソッドチェーンをサポートします。 159 |

160 | 161 |

参考

162 |
    163 |
  • 往復(roundtrip)時間の詳しい測定の仕方については Roundtrip の測定方法 をご覧ください。
  • 164 |
165 |
166 | 167 |
is_complete()
168 |
169 |

170 | roundtrip プラグインが終了したのかどうかを確認するために BOOMR.sendBeacon() によって呼び出されます。 171 |

172 |

Returns

173 |
    174 |
  • プラグインが終了している場合は true を返します。
  • 175 |
  • プラグインが終了していない場合は false を返します。
  • 176 |
177 |
178 | 179 |
180 | 181 |

ビーコンパラメーター

182 |

183 | このプラグインはビーコンに次のパラメーターを追加します: 184 |

185 |
186 |
t_done
[オプション]ページの往復時間。
187 |
t_page
[オプション]ページの先頭から page_ready までにかかった時間。開発を加える必要があります。
188 |
t_other
[オプション]ページの開発者によって設定されたコンマ区切りのタイマーのリスト。それぞれのタイマーのフォーマットは name|value になります。
189 |
r
ビーコンの開始時間を設定したページの URL 。
190 |
r2
[オプション]現在のページのリファラーの URL 。r と異なり、strict_referrer が明示的にオフになっている場合のみ設定されます。
191 |
192 | 193 | 194 | 195 | 198 | 199 | 200 | 201 | 205 | -------------------------------------------------------------------------------- /doc/ja/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Boomerang API 6 | 7 | 8 | 9 | ドキュメント一覧 10 |

boomerang API

11 |

コア

12 | 16 | 17 |

コアプラグイン

18 | 22 | 23 |

追加プラグイン

24 | 31 | 32 | 35 | 36 | 37 | 38 | 42 | -------------------------------------------------------------------------------- /doc/ja/api/ipv6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IPv6 プラグイン API 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | API 10 |

IPv6 プラグイン API

11 |

12 | 注意:この IPv6 プラグインはまだテストされていません。テストに協力してくれる方を歓迎します。 13 |

14 |

15 | IPv6 プラグインは IPv6 に関する様々なメトリクスを測定します。IPv6 API は BOOMR.plugins.IPv6 に内包されます。このプラグインはいくつかの事を試そうとします: 16 |

17 | 23 |

24 | このプラグインは IPv6 アドレスを持ったサーバーと DNS がそのサーバーを指している必要があります。さらに、サーバーは IPv6 アドレスからのリクエストを処理できるように設定されている必要があり、バーチャルホスト名は必要ありません。これはおそらく、同じ IP アドレス上に複数のホストを共有してホスティングできないということになります。 25 |

26 | 27 |

設定

28 |

29 | 全ての設定は IPv6 の名前空間の下に入ります。 30 |

31 |
32 |
ipv6_url
33 |
IPv6 アドレスを参照する画像 URL、例えば、http://fe80::1/image-i.png 。もし指定されていなければ、テストは中止されます。
34 |
host_url
35 |
[推奨] 36 | DNS ホスト名によって IPv6 アドレスのみ参照される画像 URL 。ホスト名は IPv4 アドレスを解決する必要はありません。もし記述されていなければ、ホストテストはスキップされます。 37 |
38 |
timeout
39 |
[オプション] 40 | boomerang がリクエストに失敗したと仮定して諦めるまでの時間をミリ秒で指定します。デフォルトは1200ミリ秒です。 41 |
42 |
43 | 44 |

メソッド

45 | 46 |
47 | 48 |
init(oConfig)
49 |
50 |

51 | IPv6 プラグインを設定するために BOOMR.init() メソッドによって呼び出されます。詳しくは 設定項目の説明 をご覧ください。 52 |

53 |
 54 | BOOMR.init({
 55 | 		IPv6: {                                                         
 56 | 		            ipv6_url: "http://fe80::1/images/image-i.png"       
 57 | 		            host_url: "http://yoursite-6.com/images/image-i.png"
 58 | 		}                                                               
 59 | 	});
 60 | 
61 | 62 |

返り値

63 |

64 | BOOMR.plugins.IPv6 オブジェクトへの参照。メソッドチェーンをサポートします。 65 |

66 |

注意

67 |

68 | IPv6 テストは ipv6_url が設定されていないと実行されません。 69 |

70 |
71 | 72 |
is_complete()
73 |
74 |

75 | IPv6 プラグインが終了したのかどうかを確認するために BOOMR.sendBeacon() によって呼び出されます。 76 |

77 |

返り値

78 |
    79 |
  • プラグインが終了している場合は true を返します。
  • 80 |
  • プラグインが終了していない場合は false を返します。
  • 81 |
82 |
83 | 84 |
85 | 86 |

ビーコンパラメーター

87 |

88 | このプラグインはビーコンに2つのパラメーターを追加します。ともに ipv6_ のプレフィックスがつきます: 89 |

90 |
91 |
ipv6_latency
92 |
IP へ接続したときに IPv6 のホストからデータを取得したときのレイテンシーをミリ秒にしたもの。クライアントが IPv6 のホストへ接続できなかった場合は NA がセットされます。
93 |
ipv6_lookup
94 |
IPv6 アドレスを解決したホスト名からデータを取得したレイテンシー。クライアントが IPv6 のホストへ接続できなかった場合は NA がセットされます。
95 |
96 | 97 | 100 | 101 | 102 | 103 | 107 | -------------------------------------------------------------------------------- /doc/ja/api/navtiming.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Navigation Timing プラグイン API 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | API 10 |

Navigation Timing プラグイン API

11 |

12 | 注意:この Navigation Timing プラグインはまだテストされていません。テストに協力してくれる方を歓迎します。 13 |

14 |

15 | Navigation Timing プラグインは W3C Navigation Timing の仕様をサポートしているモダンなユーザーエージェントによって回収されたメトリクスを回収します。Navigation Timing API は BOOMR.plugins.NavigationTiming に内包されます。 16 |

17 | 18 |

19 | 注意 Navigation Timing プラグインはデフォルトでは boomerang.js には含まれていません。詳しい boomerang へのプラグインの含め方については 使用方法 #9 をご覧ください。 20 |

21 | 22 |

メソッド

23 | 24 |
25 | 26 |
init()
27 |
28 |

29 | Navigation Timing プラグインを設定するために BOOMR.init() メソッドによって呼び出されます。 30 | Navigation Timing プラグインは設定パラメーターを必要としないため、シンプルにブラウザーの window.performance オブジェクト(もしあれば)から値を参照して、それらをビーコンのクエリー文字に追加します。 31 |

32 | 33 |

返り値

34 |

35 | BOOMR.plugins.NavigationTiming オブジェクトへの参照。メソッドチェーンをサポートします。 36 |

37 |

注意

38 |

39 | ユーザーエージェントが Navigation Timing の仕様を実装していない場合、プラグインはビーコンにパラメーターを追加しません。 40 |

41 |
42 | 43 |
is_complete()
44 |
45 |

46 | Navigation Timing プラグインが終了したのかどうかを確認するために BOOMR.sendBeacon() によって呼び出されます。 47 |

48 |

返り値

49 |
    50 |
  • プラグインが終了している場合は true を返します。
  • 51 |
  • プラグインが終了していない場合は false を返します。
  • 52 |
53 |
54 | 55 |
56 | 57 |

ビーコンパラメーター

58 |

59 | Navigation Timing プラグインはビーコンに次のパラメーターを追加します。それぞれブラウザーの Navigation Timing API の属性に対応しています。 60 |

61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 |
ビーコンパラメーターNavigation Timing 属性
nt_red_cntwindow.performance.navigation.redirectCount
nt_nav_typewindow.performance.navigation.type
nt_nav_stwindow.performance.timing.navigationStart
nt_red_stwindow.performance.timing.redirectStart
nt_red_endwindow.performance.timing.redirectEnd
nt_fet_stwindow.performance.timing.fetchStart
nt_dns_stwindow.performance.timing.domainLookupStart
nt_dns_endwindow.performance.timing.domainLookupEnd
nt_con_stwindow.performance.timing.connectStart
nt_con_endwindow.performance.timing.connectEnd
nt_req_stwindow.performance.timing.requestStart
nt_res_stwindow.performance.timing.responseStart
nt_res_endwindow.performance.timing.responseEnd
nt_domloadingwindow.performance.timing.domLoading
nt_domintwindow.performance.timing.domInteractive
nt_domcontloadedwindow.performance.timing.domContentLoaded
nt_domcompwindow.performance.timing.domComplete
nt_load_stwindow.performance.timing.loadEventStart
nt_load_endwindow.performance.timing.loadEventEnd
nt_unload_stwindow.performance.timing.unloadEventStart
nt_unload_endwindow.performance.timing.unloadEventEnd
nt_ssl_st[オプション] window.performance.secureConnectionStart
89 | 90 | 93 | 94 | 95 | 96 | 100 | -------------------------------------------------------------------------------- /doc/ja/community.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | boomerang コミュニティ 6 | 7 | 8 | 9 | ドキュメント一覧 10 |

boomerang コミュニティ

11 |

12 | boomerang は BSD ライセンス のもとでリリースされたオープンソースの JavaScript ライブラリーです。コミュニティ上の活動もそれに依存します。 13 |

14 | 15 |

ソースコード

16 |

17 | ソースコードは GitHub の github.com/lognormal/boomerang に公開されています。自由に fork して貢献してください。また、ソースコードの tarball や zip アーカイブ も取得できます。 18 |

19 | 20 |

バグとディスカッション

21 |

22 | バグの報告や機能のディスカッションには GitHub の issue tracking system を利用します。 23 |

24 | 25 | 26 | 27 | 31 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-10-page#1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #10: Google Chrome による prerendered されたページの読み込み時間 5 | 6 | 7 | 8 | 9 | 10 | ドキュメント一覧 | 使用方法一覧 11 |

Boomerang 使用方法 #10:
Google Chrome による prerendered されたページの読み込み時間

12 |

13 | このユースケースは Google Chrome 13 に実装された prerender 機能をベースにしています。 14 | ページに読み込むコードはあなたが prerender を利用するかどうかに関わらず同じになります。この使用方法はそれらを配慮していません。 15 | しかしながら、特定のページの prerender を有効にするには、元のドキュメントにあるリンク要素としてそのページの URL を含めます。 16 | 例えば、元のページの HEAD の中にこのようなコードを埋め込みます: 17 |

18 |
19 | <link rel="prerender" href="howto-10-page%232.html">
20 | 
21 |

22 | これは howto-10-page#2.html と全てのそのリソースを先読みすることを Chrome に明示して、ユーザーが見えないバックグランドでレンダリングを開始します。 23 | ユーザーがドキュメントのリンクをクリックすると、すぐに表示されます。 24 |

25 |

26 | パフォーマンスを気にするエンジニアなら、その全体でどれくらい時間を要したか知りたくなると思います。個別には次のような点が気になると思います: 27 |

28 |
    29 |
  1. クリックしてから表示されるまでの時間
  2. 30 |
  3. fetchStart/navigationStart から prerender が終わるまでの時間
  4. 31 |
  5. fetchStart/navigationStart から表示されるまでの時間
  6. 32 |
  7. prerender が終わってから表示されるまでの時間
  8. 33 |
34 |

35 | それでは、あなたが2番目のページのレンダリングを完了するために、このページを十分時間をかけて読んだことに期待しましょう。 36 |

37 | 38 |

39 | ページの読み込みテスト結果を確認するために 2番目のページ に移動してください。 40 |

41 | 42 | 45 | 46 |

47 |

48 | 49 | 50 | 51 | 61 | 62 | 63 | 67 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-10-page#2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #10: Google Chrome による prerendered されたページの読み込み時間 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #10:
Google Chrome による prerendered されたページの読み込み時間

11 |

12 | このユースケースは Google Chrome 13 に実装された prerender 機能をベースにしています。このユースケースのために2つのページを使います。このページはサンプルの2番目のページになります。詳しい説明は 1番目のページ をご覧ください。 13 |

14 | 15 |

16 | 1番目のページ からこのページへクリックしていれば、下の方にパフォーマンスの結果が確認できるはずです。もしこれが帯域幅のテスト以来の初回のテストなら6秒ほど時間がかかるかもしれません。1番目のページからリンクをクリックすれば同じ結果を確認できます。 17 |

18 | 19 |

20 | 下のボックス内で、rt.start に cookie が設定されていれば、次のようなことが確認できるはずです: 21 |

22 |
    23 |
  1. t_done (load time): クリックしてから表示されるまでの時間 (perceived load time)
  2. 24 |
  3. t_load: fetchStart/navigationStart から prerender が終わるまでの時間
  4. 25 |
  5. t_prerender: fetchStart/navigationStart から表示されるまでの時間
  6. 26 |
  7. t_postrender: prerender が終わってから表示されるまでの時間
  8. 27 |
28 |

29 | もし rt.start に navigation(かそれ以外)が設定してあれば、t_done は t_prerender と同じになります。もし t_prerender が設定されていなければ、このページは prerender されておらず、t_done は実際の読み込み時間と認識されています。 30 |

31 | 32 | 35 | 36 |

37 |

38 | 39 | 40 | 41 | 51 | 52 | 53 | 57 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-1a-page#1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #1a: ページ上のリンクをユーザーがクリックし onload イベントが発生した時にページは有効になる 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #1a:
ページ上のリンクをユーザーがクリックし onload イベントが発生した時にページは有効になる

11 |

12 | この要件の説明は ユースケース #1 をご覧ください。 13 |

14 |

15 | このユースケースのために2つのページを使います。あなたのサイト上の2つのページに同じコードを埋め込みます。最初から始める場合はこのようになります: 16 |

17 |
    18 |
  1. あなたのドキュメントルートに boomerang.js と images/ ディレクトリーをコピーします
  2. 19 |
  3. 次のコードをあなたの全てのページに追加します:
  4. 20 |
21 |
22 | <script src="boomerang.js" type="text/javascript"></script>
23 | <script type="text/javascript">
24 | BOOMR.init({
25 | 		user_ip: "<user's ip address>",
26 | 		beacon_url: "http://yoursite.com/path/to/beacon.php"
27 | 	});
28 | </script>
29 | 
30 |

31 | これはあなたのサイトにきたユーザーが訪れた一番最初のページを除いて、ページの読み込み時間の測定には十分なものになります。PHP や Python、C# といったようなサーバーサイドの言語を使ってユーザーの IP アドレスを取得する必要があります。これはリクエスト間の帯域幅を計算した結果を保存するために必要になります。 32 |

33 | 34 |

35 | ページの読み込みテストの結果を見るには ページ #2 へ移動してください。 36 |

37 | 38 |

より複雑なサイト

39 |

40 | 長い間ウェブサイトをやっていると JavaScript を CDN を使ってホスティングしたり、サブディレクトリーをもったページがあったりする場合があります。そういった場合は、boomerang.js へのリンクを絶対パスに変更します。帯域幅のテスト用の画像の場所も boomerang に設定する必要があります。init() をこのようにして呼び出します: 41 |

42 |
43 | BOOMR.init({
44 | 		user_ip: "<user's ip address>",
45 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
46 | 		BW: {
47 | 			base_url: 'http://yoursite.com/path/to/bandwidth/images/"
48 | 		}
49 | 	});
50 | 
51 |

52 | 注意、これは画像ディレクトリの場所を示します。あなたがユーザーの帯域幅や遅延を測定したいサーバー上に画像を配置することを推奨します。これはほとんど場合はあなたのサーバー上で行うことになるとは思いますが、もしかすると代わりにそれらのファイルを CDN に置いて帯域幅や遅延を測定したい場合もあるかもしれません。判断は任せますが、あなたのサーバー上に配置することをおすすめします。 53 |

54 | 55 |

56 | ページの読み込みテストの結果を見るには ページ #2 へ移動してください。 57 |

58 | 59 | 62 | 63 |

64 |

65 | 66 | 67 | 68 | 80 | 81 | 82 | 86 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-1a-page#2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #1a: ページ上のリンクをユーザーがクリックし onload イベントが発生した時にページは有効になる 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #1a:
ページ上のリンクをユーザーがクリックし onload イベントが発生した時にページは有効になる

11 |

12 | この要件の説明は ユースケース #1 をご覧ください。 13 |

14 |

15 | このユースケースでは2つのページを使います。これはサンプルの2番目のページになります。詳しい説明は 1番目のページ をご覧ください。 16 |

17 | 18 |

19 | 1番目のページ からリンクをクリックして遷移すると、下にパフォーマンスの結果が確認できるはずです。初回のテストの場合は帯域幅のテストから約6秒ほどかかる場合があります。1ページ目へのリンクをクリックして1ページへ戻っても同様の結果を確認できます。 20 |

21 | 22 | 25 | 26 |

27 |

28 | 29 | 30 | 31 | 43 | 44 | 45 | 49 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-1b-page#1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #1b: ページ上のリンクをユーザーがクリックし開発者が決めたポイントでページを有効にできる 5 | 6 | 7 | 8 | 9 | All Docs | Index 10 |

Boomerang 使用方法 #1b:
ページ上のリンクをユーザーがクリックし開発者が決めたポイントでページを有効にできる

11 |

12 | この要件の説明は ユースケース #1 をご覧ください。 13 |

14 |

15 | このユースケースのために2つのページを使います。あなたのサイト上の2つのページに同じコードを埋め込みます。今回のケースでは 1a とは違い、onload イベントが発生したときにビーコンを送信させません。代わりに決めたページが準備完了となる時点で page_ready イベントを発生させます。また、自動的に実行された boomerang を停止するために autorun パラメーターを false にできます。 16 |

17 |
    18 |
  1. あなたのドキュメントルートに boomerang.js と images/ ディレクトリーをコピーします
  2. 19 |
  3. 次のコードをあなたの全てのページに追加します。ページの読み込みがまだ完了する前の任意の場所に追加します。
  4. 20 |
21 |
22 | <script src="boomerang.js" type="text/javascript"></script>
23 | <script type="text/javascript">
24 | BOOMR.init({
25 | 		user_ip: "<user's ip address>",
26 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
27 | 		autorun: false
28 | 	});
29 | </script>
30 | 
31 |

32 | 残りのページはそのまま読み込まれます。ユーザーがページを表示しページが有効となったときに、次のように page_ready イベントを発生させる必要があります。 33 |

34 | 35 |
36 | BOOMR.page_ready();	// Tell boomerang that the page is now usable
37 | 
38 | 39 |

40 | 使用方法 1a のときのようにバックエンドの言語を使って user_ip を追加する必要があります。 41 |

42 | 43 |

44 | ページの読み込みテストの結果を見るには ページ #2 へ移動してください。 45 |

46 | 47 | 50 | 51 |

52 |

53 | 54 | 55 | 56 | 72 | 73 | 74 | 78 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-1b-page#2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #1b: ページ上のリンクをユーザーがクリックし開発者が決めたポイントでページを有効にできる 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #1b:
ページ上のリンクをユーザーがクリックし開発者が決めたポイントでページを有効にできる

11 |

12 | この要件の説明は ユースケース #1 をご覧ください。 13 |

14 |

15 | このユースケースでは2つのページを使います。これはサンプルの2番目のページになります。詳しい説明は 1番目のページ をご覧ください。 16 |

17 | 18 |

19 | 1番目のページ からリンクをクリックして遷移すると、下にパフォーマンスの結果が確認できるはずです。ページが読み込まれた後に page_ready イベントを発生できるかを伝えるために意図的に750msの遅延を挿入します。初回のテストの場合は帯域幅のテストから約6秒ほどかかる場合があります。1ページ目へのリンクをクリックして1ページへ戻っても同様の結果を確認できます。 20 |

21 | 22 | 25 | 26 |

27 |

28 | 29 | 30 | 31 | 47 | 48 | 49 | 53 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #2: 動的な読み込みのパフォーマンスを認識して測定する 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #2:
動的な読み込みのパフォーマンスを認識して測定する

11 |

12 | この要件の説明は ユースケース #2 をご覧ください。 13 |

14 |

15 | このドキュメントは XHR を使っていくつかのコンテンツの読み込みを試し、boomerang を使ってそのコンテンツの読み込みかかった時間を測定します。次のようにして行ないます: 16 |

17 |
    18 |
  1. あなたのドキュメントルートに boomerang.js と images/ ディレクトリーをコピーします
  2. 19 |
  3. 次のコードをあなたのページの XHR を呼び出す前のどこかに追加します
  4. 20 |
21 |
 22 | <script src="boomerang.js" type="text/javascript"></script>
 23 | <script type="text/javascript">
 24 | BOOMR.init({
 25 | 		user_ip: "<user's ip address>",
 26 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
 27 | 		auto_run: false
 28 | 	});
 29 | </script>
 30 | 
31 | 32 |

33 | 次にあなたのコンテンツを取得します。コンテンツの取得を呼び出す直前にタイマーが開始します。読み込み時間のタイマーは t_done と呼ばれます。コンテンツの取得が終わったときのコールバック関数の中で done() メソッドが呼び出されます。この測定とビーコンがレスポンスタイムを返します。以下は YUI 3 を使ったコードですが、あなたの好きな書き方をしてもいいです。 34 |

35 | 36 |
 37 | YUI().use("io-base", function(Y) {
 38 |     var uri = "dynamic-content.txt";
 39 | 
 40 |     function complete(id, o) {
 41 |         var html = o.responseText;
 42 | 	document.getElementById("dynamic-content").innerHTML = html;
 43 | 	BOOMR.plugins.RT.done();	// Tell boomerang to measure time and fire a beacon
 44 |     };
 45 | 
 46 |     Y.on('io:complete', complete);
 47 | 
 48 |     BOOMR.plugins.RT.startTimer("t_done");	// Start measuring download time
 49 |     var request = Y.io(uri);
 50 | });
 51 |  
52 | 53 | 56 | 57 |

58 |

59 | 60 |
61 |
62 | 63 | 64 | 65 | 66 | 94 | 95 | 96 | 100 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #3: ページの読み込み時間と一緒にユーザーの帯域幅や遅延を測定する 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #3:
ページの読み込み時間と一緒にユーザーの帯域幅や遅延を測定する

11 |

12 | この要件の説明は ユースケース #3#5 をご覧ください。 13 |

14 | 15 |

16 | 初期状態では boomerang は常にユーザーの帯域幅と HTTP の遅延を測定し、それらの数値を送信するビーコンに追加します。実際には、帯域幅プラグイン(BOOMR.plugins.BW)がこれを行いますが、boomerang の中にバンドルされているもので、違いは単なる伝統的なものです。帯域幅を効率的に検出するためにいくつか知っておくべきことがあります。 17 |

18 | 19 |

20 | まず JavaScript による帯域幅の検知は正確ではありません。もしユーザーのネットワークが損失が多かったり、他のユーザーと共有していたら、もしくはネットワークのトラフィックが集中的だったら。実際の帯域幅は時間の経過とともに変化します。私たちが測定するのは短時間のものを基準としたもののため、これが最善か最悪の代表的なケースにはならないかもしれません。帯域幅以外の測定もカバーしようとしますが、その測定でもエラーの値も返します。 21 |

22 | 23 |

24 | 帯域幅のテストを開始するには単純にページに boomerang を追加して init() メソッドを呼び出すだけで十分です。そうするとビーコンがサーバーに結果を送ります。このようなコードを使います: 25 |

26 |
 27 | <script src="boomerang.js" type="text/javascript"></script>
 28 | <script type="text/javascript">
 29 | BOOMR.init({
 30 | 	beacon_url: "http://yoursite.com/path/to/beacon.php",
 31 | 	BW: {
 32 | 		base_url: "http://base_url/to/bandwidth/images/"
 33 | 	}
 34 | });
 35 | </script>
 36 | 
37 |

38 | BW.base_url パラメーターの初期値は images/ です。もし帯域幅を検出する画像が現在のディレクトリーの images サブディレクトリーにある場合は、BW.base_url パラメーターを設定する必要はありません。複数のディレクトリーがあることもあるかもしれませんが、そのときは良い実践になるでしょう。 39 |

40 | 41 |

42 | これが帯域幅と遅延を測定してビーコンを返すために必要となる最小限のコードです。あなたのユーザーにとっては最善のオプションではありません。テストはユーザーの帯域幅がほとんど変わっていないのにも関わらず、サイト上のページに訪れるたびに毎回実行されます。一定期間、帯域幅を Cookie に格納しておくとはるかに良くなり、もしその Cookie があればそこから取得します。現在、ユーザーは複数のネットワーク間を移動できます。例えばラップトップを自宅で使ったり、職場やコーヒーショップで使ったり。これらの帯域幅や遅延は場所によって異なるかもしれないため、これらを切り分けて測定することが大切です。私たちはユーザーの IP アドレスを通してネットワークの変更を判断し、Cookie にユーザーの帯域幅を格納するため、boomerang にユーザーの IP アドレスを伝える必要があります。これを user_ip パラメーターを使って行ないます。 43 |

44 | 45 |
 46 | <script src="boomerang.js" type="text/javascript"></script>
 47 | <script type="text/javascript">
 48 | BOOMR.init({
 49 | 	beacon_url: "http://yoursite.com/path/to/beacon.php",
 50 | 	user_ip: "<user's ip>",
 51 | 	BW: {
 52 | 		base_url: "http://base_url/to/bandwidth/images/"
 53 | 	}
 54 | });
 55 | </script>
 56 | 
57 | 58 |

59 | 私の知る限りでは、JavaScript でユーザーの IP アドレスを算出する方法はありません。これはサーバーサイドで行ってあなたのコードに記述しなければなりません。 60 |

61 | 62 |

IPv4 最適化

63 |

64 | もしユーザーが IPv4 アドレスを持っていた場合、私たちは IP の最後の部分を除去して、完全な IP アドレスよりもそれを使用します。これはユーザーが同じ ISP 上の DHCP を使用している場合、IP アドレスは頻繁に変更されますが、同じサブネット内に留まるため効果がでます。もしユーザーが IPv6 アドレスを持っている場合はアドレス全体を使用します。 65 |

66 | 67 |

Cookie

68 |

69 | 帯域幅が格納される Cookie の名前をカスタマイズしたい場合もあると思います。初期値は BA になっていますが、これは BW.cookie パラメーターで変更することができます。 70 |

71 | 72 |
 73 | <script src="boomerang.js" type="text/javascript"></script>
 74 | <script type="text/javascript">
 75 | BOOMR.init({
 76 | 	beacon_url: "http://yoursite.com/path/to/beacon.php",
 77 | 	user_ip: "<user's ip>",
 78 | 	BW: {
 79 | 		base_url: "http://base_url/to/bandwidth/images/",
 80 | 		cookie: "BW"
 81 | 	}
 82 | });
 83 | </script>
 84 | 
85 | 86 |

87 | この Cookie は7日間有効です。BW.cookie_exp パラメーターを使って有効期限の変更もできます。値は秒です。その間、サーバーサイドで Cookie の値も取得することができます。フォーマットは以下の通りです: 88 |

89 | 90 |
 91 | BA=ba=nnnnnnn&be=nnn.nn&l=nnnn&le=nn.nn&ip=iiiiii&t=sssssss;
 92 | 
93 |

94 | 定義されているパラメーター: 95 |

96 |
97 |
ba
98 |
[integer] [バイト/秒] あなたのサーバーにおけるユーザーの帯域幅
99 |
be
100 |
[float] [バイト/秒] 測定したユーザーの帯域幅からエラーを除いた95%信頼できる値
101 |
l
102 |
[float] [ミリ秒] ユーザーのコンピューターとあなたのサーバー間の HTTP 遅延
103 |
le
104 |
[float] [ミリ秒] 測定したユーザーの遅延からエラーを除いた95%信頼できる値
105 |
ip
106 |
[IP アドレス] init() メソッドに user_ip パラメーターとして渡されたユーザーの IPv4 アドレスまたは IPv6 アドレス
107 |
t
108 |
[タイムスタンプ] Cookie がセットされた時のブラウザーの時間(UNIX time)
109 |
110 | 111 |

112 | これらのパラメーターはビーコンに送信されます(使用方法 #0 をご覧ください)が、Cookie にこれらを持っているということはリクエストを処理する前に帯域幅をもとにユーザーエクスペリエンスをカスタマイズできるということを意味します。 113 |

114 | 115 |

帯域幅のチェックを無効にする

116 |

117 | 最後に、帯域幅のテストを完全に無効にしたい場合があるかもしれません。おそらくあなたはユーザーが遅いネットワークを使っていたり、バイト単位で料金を払っていたり(帯域幅のテストはたくさんの帯域幅を使用します)、モバイルデバイスを使っていたりして読み込みきれないことを考えていると思います。その場合は2つの方法があります。 118 |

119 |
    120 |
  1. boomerang.js のコピーから帯域幅プラグインを削除する
  2. 121 |
  3. BW.enabled パラメーターを false にする:
  4. 122 |
123 |
124 | <script src="boomerang.js" type="text/javascript"></script>
125 | <script type="text/javascript">
126 | BOOMR.init({
127 | 	BW: { enabled: false  }
128 | });
129 | </script>
130 | 
131 | 132 | 135 | 136 |

137 |

138 | 139 | 140 | 141 | 153 | 154 | 155 | 159 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 22 | Boomerang 使用方法 #4: さらに正確なページの読み込み時間を測定する 23 | 24 | 25 | 29 | 30 | 31 | ドキュメント一覧 | 使用方法一覧 32 |

Boomerang 使用方法 #4: さらに正確なページの読み込み時間を測定する

33 |

34 | この要件の説明は ユースケース #4 をご覧ください。 35 |

36 |

37 | 今まではページがユーザーによって有効になったときの時間を測定していました。また、これはページ全体の読み込み時間に遅れずにページ内の異なるコンポーネントにかかる時間を測定するには役立つかもしれません。boomerang はページの一部分を測定するための設定が可能なタイマーを追加する機能を提供します。これを行うには roundtrip(BOOMR.plugin.RT)プラグインの startTimer()endTimer() メソッドを使用します。 38 |

39 | 40 |

41 | 以下の例では、boomerang.js が読み込まれているかの確認とこれらのメソッドを呼び出す前に init() メソッドが呼び出されているか確認する必要があります。おそらくページの先頭にそれを配置するといいでしょう。これをどう使うかはこの後確認します。 42 |

43 | 44 |

45 | まず最初に、あなたが測定したいページの領域を決めます。前で startTimer() を、後で endTimer() を呼び出します。それぞれのタイマーには自身の名前を持ちます。名前は自由な文字列でつけられますが、効率的にするためにシンプルな名前がいいでしょう。英数字とアンダースコアで、最大5文字の名前にしてください。例えば、t_adst_headt_js といった感じです。また、次の名前は予約されています: t_donet_paget_resp 46 |

47 | 48 |

49 | タイマーを開始する前に boomerang.js が読み込まれていることを確認してください。 50 |

51 | 52 |
 53 | <html>
 54 |   <head>
 55 |     <script src="boomerang.js" type="text/javascript"></script>
 56 |     <script type="text/javascript">
 57 |       BOOMR.init({
 58 | 		beacon_url: "http://yoursite.com/path/to/beacon.php"
 59 |       });
 60 |       BOOMR.plugins.RT.startTimer("t_head");
 61 |     </script>
 62 |     <title>page title</title>
 63 |     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
 64 |     <link rel="stylesheet" type="text/css" href="../../boomerang-docs.css">
 65 |     <script type="text/javascript">
 66 |       BOOMR.plugins.RT.endTimer("t_head").startTimer("t_body");
 67 |     </script>
 68 |   </head>
 69 |   <body>
 70 |     page body here
 71 |     <script type="text/javascript">
 72 |       BOOMR.plugins.RT.endTimer("t_body");
 73 |     </script>
 74 |   </body>
 75 | </html>
 76 | 
77 | 78 |

79 | タイマーは t_done と一緒にビーコンに読み込まれます。 80 |

81 | 82 |

83 | endTimerstartTimer をチェーンして呼び出すときは順番に注意してください。ほとんどのメソッドはオブジェクトの参照を返すためこれが可能になります。タイマーのメソッドは BOOMR.plugins.RT オブジェクト上にあることも注意してください。メソッドの返り値はそのオブジェクトであって、BOOMR オブジェクトではありません。 84 |

85 | 86 |

boomerang より前のコンテンツの読み込み時間を測定する

87 |

88 | 私たちは何年もパフォーマンスのためにドキュメントの下に JavaScript を配置すると良いと言ってきました。いいアドバイスではないかもしれませんが、ドキュメントの上部で boomerang を読み込んでください。そうすればページ内で時間を測定できます。読み込みが終われば1度だけ boomerang にそれらの結果を渡します。これは BOOMR.plugins.RT.setTimer() メソッドを使って行ないます。このメソッドは2つのパラメーターを取ります — タイマーの名前とミリ秒の時間の値です。コードはこのようになります: 89 |

90 | 91 |
 92 | <html>
 93 |   <head>
 94 |     <script type="text/javascript">
 95 |       var t_pagestart=new Date().getTime();
 96 |     </script>
 97 |     <title>page title</title>
 98 |     <meta http-equiv="Content-type" content="text/html; charset=utf-8">
 99 |     <script type="text/javascript">
100 |       var t_headend = new Date().getTime();
101 |     </script>
102 |   </head>
103 |   <body>
104 |     page body here
105 |     <script type="text/javascript">
106 |       var t_jsstart = new Date().getTime();
107 |     </script>
108 |     <script src="boomerang.js" type="text/javascript"></script>
109 |     <script type="text/javascript">
110 |       BOOMR.init({
111 | 		beacon_url: "http://yoursite.com/path/to/beacon.php"
112 |       });
113 |       var t_bodyend = new Date().getTime();                        
114 |       BOOMR.plugins.RT.setTimer("t_head", t_headend - t_pagestart).
115 |                        setTimer("t_body", t_bodyend - t_headend).  
116 |                        setTimer("t_js", t_bodyend - t_jsstart);    
117 |     </script>
118 |   </body>
119 | </html>
120 | 
121 | 122 | 125 | 126 |

127 |

128 | 131 | 132 | 135 | 136 | 137 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #5: リクエストとページにタグをつける 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #5: リクエストとページにタグをつける

11 |

12 | この要件の説明は ユースケース #5 をご覧ください。 13 |

14 |

15 | サーバーに送ったビーコンに多くの情報を追加しなければならない場合はたびたびあると思います。例えば、page_id と一緒にビーコンにタグをつけたり、A/B テストを行ったり、ビーコンのためにバケットを指定するパラメーターと一緒にビーコンにタグをつけたりしたいかもしれません。これらを BOOMR.addVar() メソッドを使って実現することができます。 16 |

17 | 18 |

19 | このメソッドを使う前に、それぞれのプラグインは自身のパラメーターを追加すること、これらをあなた自身で上書きする必要がないことを覚えておいてください。boomerang にビルトインされているプラグインが設定するパラメーターの一覧は 使用方法 #0 をご覧ください。その他のプラグインは自身のパラメーターを追加するかもしれません。その場合はプラグインのドキュメントを参考にしてください。 20 |

21 | 22 |
 23 | BOOMR.addVar("page_id", 123);
 24 | 
25 | 26 |

27 | パラメーターの名前は文字列でなければなりません。英数字とアンダースコアのみを使用することを推奨しますが、好きなものを使ってかまいません。パラメーターの値は数値か文字列になりますので、URL の中に置き換えることができます。 28 |

29 | 30 |

31 | もし複数のパラメーターが必要なら、代わりにオブジェクトを使って渡します: 32 |

33 | 34 |
 35 | BOOMR.addVar({
 36 | 		"bucket": "test#1",
 37 | 		"page_id": 123
 38 | 	});
 39 | 
40 | 41 |

42 | BOOMR.addVar() を呼び出す前に boomerang.js が読み込まれているか確認してください。 43 |

44 | 45 |

ビーコン

46 |

47 | ビーコンは URL の中に追加した値を全て含めます。キーと値はともに URL エンコードされます。バックエンドのアプリケーションはパラメーターが渡されることを知っておく必要があります。 48 |

49 | 50 |
 51 | http://yoursite.com/path/to/beacon.php?bucket=test%231&page_id=123&t_done=.....
 52 | 
53 | 54 |

値を削除する

55 |

56 | あなたが追加した(またはプラグインが追加した)パラメーターをビーコンから削除することもできます。これを行うには BOOMR.removeVar() メソッドを呼び出します。このメソッドは名前のリストを取り、パラメーターのリストから全てを削除します。パラメーターのリストにない名前は無視されます。 57 |

58 | 59 |
 60 | // don't send the stooges to the server   
 61 | BOOMR.removeVar("larry", "moe", "curly");
 62 | 
63 | 64 |

ビーコンを停止する

65 |

66 | ビーコンの発生を止める大ざっぱな方法もあります。before_beacon イベントハンドラーの中で、全てのパラメーターを単純に削除します。 67 |

68 | 69 |
 70 | BOOMR.subscribe('before_beacon', function(o) {
 71 | 	var p_names = [], k;
 72 | 
 73 | 	if( "t_done" in o ) {
 74 | 		return;
 75 | 	}
 76 | 
 77 | 	// t_done is not set, so don't beacon         
 78 | 	for(k in o) {
 79 | 		if(o.hasOwnProperty(k)) {
 80 | 			p_names.push(k);
 81 | 		}
 82 | 	}
 83 | 
 84 | 	// removeVar accepts either a list or an array
 85 | 	BOOMR.removeVar(p_names);
 86 | });
 87 | 
88 | 89 | 92 | 93 |

94 |

95 | 96 | 97 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #6: boomerang を設定する 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #6: boomerang を設定する

11 |

12 | boomerang を使用するためには最初に boomerang.js を HTML の中に読み込み、BOOMR.init() メソッドを呼び出します。ページのパフォーマンスを測定するにはこれで十分のはずですが、サイトの管理者として十分役立つとは限りません。これだけではまだサーバーに送ったデータを取得することはできませんし、ユーザーの帯域幅も測定できません。 13 |

14 |

15 | このドキュメントでは、あなたが使用できる boomerang の設定とビルトインのプラグインのパラメーターの違いについて説明します。もし追加のプラグインを使っている場合はその設定についてはプラグインのドキュメントを参考にしてください。 16 |

17 | 18 |

boomerang の設定

19 |

20 | boomerang とそのプラグインを設定するには、init() メソッドに設定オブジェクトを渡します。 21 |

22 |
 23 | BOOMR.init({
 24 | 		key: value,
 25 | 		...
 26 | 	});
 27 | 
28 |

29 | boomerang には以下のパラメーターがあります: 30 |

31 |
32 |
beacon_url
33 |
34 | [強く推奨] 35 | ビーコンの結果を送る URL 。全てのパラメーターはこの URL の QueryString に追加されます。この URL は QueryString 部分を事前に持っておく必要はありません。このパラメーターには初期値はありません。もし設定されていなければビーコンは送信されません。 36 |
37 | 38 |
site_domain
39 |
40 | [推奨] 41 | 全ての Cookie がセットされるドメイン。boomerang はこれを自動判別しようとしますが、あなたのサイトが foo.com の形式の場合を除き、実際には取得に失敗します。これはドメイン間で共有する帯域幅やパフォーマンスを測定したいときに役立ちます。
42 | もし複数のドメインを持っている場合はうまくいきません。別々に測定しなければなりません。 43 |
44 | 45 |
user_ip
46 |
47 | [推奨] 48 | この名前にもかかわらず、これはユーザーのコネクションをユニークに区別するために使われる自由な文字列です。これは主にユーザーの帯域幅を再測定するかどうかの判断に使われるか、または Cookie に格納される値に使われます。IPv4 アドレスや IPv6 アドレスまたはそれ以外のユーザーのコネクションを区別できるものを使うことになります。 49 |
50 | 51 |
log
52 |
53 | [オプション] 54 | 初期値では boomerang は YUI のロガーコンポーネントが見つかればそれを、Firebug が見つかれば代わりにそれを使おうと試みます。どちらもない場合は、初期状態では何もログに残しません。ログメッセージ用の関数のために log パラメーターを設定することで自身のロガーを定義することができます。
55 | この関数については: 56 |
 57 | function log(oMessage, sLevel, sSource);
 58 | 
59 | どこに:
60 |
oMessage
記録されるオブジェクトまたはメッセージ。記録するオブジェクトを決定するだけです。
61 |
sLevel
"error"、"warn"、"info"、"debug" などのログレベル。
62 |
sSource
ログメッセージのソース。通常はプラグインの名前がついた "boomerang" の文字列になります。
63 |
64 | lognull を設定することでログの記録を無効にできます。 65 |
66 | 67 |
autorun
68 |
69 | [オプション] 70 | 初期値では boomerang は自動的に実行され window.onload イベントに page_ready ハンドラーが登録されます。もし autorunfalse にすると、これは起こらず、BOOMR.page_ready() を自分で呼び出す必要があります。 71 |
72 | 73 |
<plugin_name>
74 |
75 | それぞれのプラグインは設定オブジェクトのサブオブジェクトを通して設定を行ないます。キーはプラグインの名前になります。ビルトインのプラグインの設定方法については次の各セクションをご覧ください。 76 |
77 | 78 |
79 | 80 |
 81 | BOOMR.init({
 82 | 		beacon_url: "http://beacons.yoursite.com/path/to/beacon.php",
 83 | 		site_domain: "yoursite.com",
 84 | 		user_ip: "202.54.1.18",
 85 | 		autorun: false
 86 | 	});
 87 | 
88 | 89 |

Roundtrip プラグイン

90 |

91 | roundtrip プラグインの全ての設定は RT の名前空間の下に入ります。 92 |

93 |
94 | 95 |
cookie
96 |
97 | [オプション] 98 | ページの読み込み時間を測定するための開始時間を格納する Cookie の名前。初期値は RT になります。 99 |
100 | 101 |
cookie_exp
102 |
103 | [オプション] 104 | 秒で表した Cookie の有効期間。これは1つのページの読み込みに負荷がかかるためできるだけ長くする必要があります。10秒以上にすればほとんどの場合は問題ありませんが、念のため遅いコネクションのユーザーをカバーするためや、地理的に遠いユーザーのために、数分は維持します。初期値は10分です。 105 |
106 | 107 |
strict_referrer
108 |
109 | [オプション] 110 | 初期値では boomerang は現在のページの document.referrerRT Cookie が一致しなければページの往復時間は測定しません。これは RT Cookie がまだ有効な状態で3番目のページを訪れたからということを意味し、ページの読み込み時間は無効となる可能性があります。
111 | このようなこともあるかもしれませんが、こういった場合は有効です — 例えば、SSL のページ間でリファラーが渡されません。この場合は、strict_referrerfalse にすればいいでしょう。 112 |
113 | 114 |
115 | 116 |
117 | BOOMR.init({
118 | 		beacon_url: "http://beacons.yoursite.com/path/to/beacon.php",
119 | 		site_domain: "yoursite.com",
120 | 		user_ip: "202.54.1.18",
121 | 		autorun: false,
122 | 		RT: {                     
123 | 		        cookie: "MyRT",   
124 | 		        cookie_exp: 120   
125 | 		}                         
126 | 	});
127 | 
128 | 129 |

Bandwidth プラグイン

130 | 131 |

132 | bandwidth プラグインの全ての設定は BW の名前空間の下に入ります。 133 |

134 | 135 |
136 |
base_url
137 |
138 | [推奨] 139 | 初期値では、bandwidth プラグインは帯域幅測定用の画像を現在のページのディレクトリーの images/ サブディレクトリーから見つけます。これはあなたのサイト上の全てのページで正しいとは限りません。画像があるディレクトリーのパスを base_url パラメーターで設定ができます。絶対 URL または相対 URL で指定ができます。相対パスの場合、JavaScript ファイルからではなく boomerang が読み込まれたページからの相対パスになることを覚えておいてください。 140 |
141 | 142 |
cookie
143 |
144 | [オプション] 145 | ユーザーのコネクションの帯域幅と遅延の測定結果を格納する Cookie の名前。初期値は BA です。詳細は 使用方法 #3 をご覧ください。Cookie を無視して開始時間を完全に WebTiming API に依存させるには、ここに null のような偽の値か空文字を指定します。 146 |
147 | 148 |
cookie_exp
149 |
150 | [オプション] 151 | 秒で表した Cookie の有効期限。初期値は7日間です。これはユーザーの帯域幅テストを再度行うまでにどれくらい空けるかを記述します。IP アドレスをもとにその間は変更されません。ネットワークコネクションの帯域幅は通常は定期的に大きくは変わらないため、実際はこの設定を何も変更する必要はありません。
152 | もしあなたがレアルタイムストリーミングのようなことを行っている場合、帯域幅のテストは適切ではなく、Cookie に短い値を設定するのは正しい方法ではありません。 153 |
154 | 155 |
timeout
156 |
157 | [オプション] 158 | ミリ秒で表した帯域幅のテスト全体のタイムアウト値。初期値は15秒です。帯域幅のテストは長時間実行できるため、時々ネットワークエラーが発生し終了しないかもしれません。タイムアウトは強制的にテストを終了させます。これはハードリミットです。もしタイムアウトになると、テストの続行を停止してこの時点で取得できているデータから帯域幅を計算しようとします。タイムアウトを長くすればさらに多くのデータを取得し精度を向上できますが、長くした分、ユーザーがページを離れる前にテストが終了しないリスクも増えます。 159 |
160 | 161 |
nruns
162 |
163 | [オプション] 164 | 帯域幅のテストを実行する回数。初期値は5回です。初回のテストは常に残りのテストを続行するためにベストな計算をするための試験的なものです。この回数が増えるとテストの精度も向上していきますが、増やした分、テストがタイムアウトするリスクも増えます。これは実行毎に約2秒から4秒かかるため、この値は timeout の値よりも超えるように考慮しなければなりません。 165 |
166 | 167 |
168 | 169 |

全てのオプション

170 |

171 | 全ての設定パラメーターはオプションですが、それらのうちいくつかを設定しないと予期しないまたは不完全な結果が起こる可能性があるため、設定すべきです。しかしながら、正しいディレクトリーに帯域幅テストの画像を置けば、コードを読み込んで init() を呼び出せば実行はできます。 172 |

173 | 174 | 177 | 178 |

179 |

180 | 181 | 182 | 183 | 195 | 196 | 197 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #7: 不正なビーコンを防ぐ 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #7: 不正なビーコンを防ぐ

11 |

12 | この要件の説明は ユースケース #9 をご覧ください。 13 |

14 | 15 |

16 | 防ぐ必要がある不正なビーコンは2種類あります: 17 |

18 |
    19 |
  1. サービス妨害(DoS)攻撃
  2. 20 |
  3. あなたのページから送信されていない偽のビーコン
  4. 21 |
22 | 23 |

サービス妨害(DoS)攻撃

24 |

25 | DoS 攻撃を防ぐために JavaScript にできることは何もありませんが、あなたのサーバーに1つの IP からのビーコンを送る制限する設定はできます。通常ウェブサイトを開けるユーザーよりも速くビーコンを受信するべきではありません。不正なアクセスパターンを見つけるために、システムのオペレーションやウェブサーバーの設定を変えたくなるでしょう。これらの大半はこのドキュメントの範囲を越えていますが、攻撃から守るためのヒントをいくつか紹介します。 26 |

27 | 28 |

29 | ほとんどの開発者は boomerang の beacon_url パラメーターを使用するバックエンドのスクリプトをつくると思います。ここで問題になるのはこれらのリクエストはキャッシュされないということです。スクリプトはビーコンのリクエストのたびに実行され、ウェブサーバーやデータベースのリソースを消費します。DoS 攻撃によって、あなたのサーバーをダウンさせることが可能になります。 30 |

31 | 32 |

33 | それをコントロールする良い方法としては、ビーコンサーバー上で動作する軽量なウェブサーバーを用意すること、このサーバーをビーコンの URL のリクエストだけに応答するように設定することです。全てのビーコンのリクエストには HTTP 204 のレスポンスを返すべきです。これはサーバー内の簡単な設定することで、リクエストごとにディスクの検索をさせる必要がないことを意味します。サーバーはリクエストをアクセスログに書き込みます。ここに全ての QueryString やパラメーター、Cookie を含める必要があります。 34 |

35 | 36 |

37 | 定期的に - 1時間に1回や1日に1回(ビーコンのボリュームに依存します)、ログをバッチ処理すればそこから実際のビーコンのパラメーターを見つけだせます。明らかに不正なビーコンは破棄します。ビーコンからデータを抽出するための実際のコードは全てのリクエストに対して行うかバッチ処理で行うかに関わらず同じです。ビーコンからのデータの抽出については 使用方法 #0 をご覧ください。 38 |

39 | 40 |

41 | オンライン上にある DoS 攻撃とその対策の仕方についての さらに 多くの 情報 も参考にしてください。 42 |

43 | 44 |

あなたのページから送信されていない偽のビーコン

45 |

46 | この場合の最も一般的な理由はあなたのページデザインを気に入った誰かがそれを自身のサーバーにコピーしてしまうことです。boomerang の JavaScript を含み、beacon_url も更新されていないとあなたのサーバーへビーコンが送信され続けます。きっと望まないことでしょう。 47 |

48 | 49 |

50 | この問題を解決する最も簡単な方法は全てのリクエストのリファラーをチェックし、あなたのドメインからではないリクエストをブロックすることです。これを知らない不正ユーザーには効果がありますが、悪意のある不正ユーザーには効果がありません。 51 |

52 | 53 |

54 | 悪意のあるユーザーはあなたのサイトの何かが得られる全ての URL を悪用しようとします。何に使うかは彼らにとって重要ではありません。これらはあなたのビーコンの正しい使用ではありませんし、全てブロックするべきです。最善の対策は noncecrumb を通すことです。これは1度だけ有効な文字列です。これにはハッシュの一部として現在のタイムスタンプと有効期限が含まれています。これをページのリクエスト毎に生成し、BOOMR.addVar() メソッドを使って boomerang に追加させます。ビーコンサーバー上で、ビーコンを受け取る前に nonce を検証します。もしバッチ処理を行っているなら、nonce を検証するために実行しているバッチ処理の時間ではなくリクエストのタイムスタンプを使うべきです。 55 |

56 | 57 |
58 | BOOMR.addVar("nonce", "125a7b79de989876cce970f0768a07");	// your nonce will be different
59 | 
60 | 61 |

62 | nonce はビーコンの URL を直接叩くものから守れますが、nonce はリクエスト毎に変更されるため、あなたのページはキャッシュできないことを意味します。 63 |

64 | 65 |

66 | nonce はあなたのページからビーコンを抜き取るものからは守れません — 正しい nonce と一緒にその時はビーコンのパラメーターを変更してあなたのサーバーに送信してきます。これを防ぐにはビーコンのパラメーターを登録する必要がありますが、これは JavaScript ではできません。この問題に対する一般的な解決方法は今のところ分かりません。 67 |

68 | 69 | 72 | 73 |

74 |

75 | 76 | 77 | 78 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #8: DNS の遅延を測定する 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #8: DNS の遅延を測定する

11 |

12 | この要件の説明は ユースケース #7 をご覧ください。 13 |

14 |

15 | 注意: この DNS プラグインはまだテストされていません。テストに協力してくれる方を歓迎します。 16 |

17 |

18 | DNS の測定にはサーバーサイドの準備がいくつか必要になります。その準備については Yahoo! のエンジニアである Carlos Bueno による ドキュメント に詳しく書かれていますので、目を通してください。要点として彼が挙げているものは: 19 |

20 |
    21 |
  1. ワイルドカードを含めたホスト名とメインサイトと共有されない Cookie を準備します。例えば60秒など、下流のキャッシュを汚染しない低い TTL を与えます。
  2. 22 |
  3. ワイルドカードを含めたホスト名で A.gifB.gif という名前の画像( images/ のサブディレクトリーから)をできるだけ速く受け取れるようにウェブサーバーの準備をします。KeepAlive や Nagle などのキャッシュのためのヘッダーがオフになっていることを確認してください。
  4. 23 |
  5. boomerang.js と一緒に dns.js を読み込みます(2つのファイルを結合しても構いません)。
  6. 24 |
  7. DNS プラグインにどこから画像を取得するかを伝えます。
  8. 25 |
26 | 27 |

28 | ステップ1とステップ2は複雑なうえ、あなたの DNS サーバーは完全にコントロールできない(例えば Dreamhost を使っている)場合、これらを行うのは難しいかもしれません。もし可能であれば、読み進めてください。 29 |

30 | 31 |

32 | プラグインを設定するために画像をどこから取得するかを伝える必要があります。帯域幅プラグインとは違い、URL にワイルドカードが必要になります: 33 |

34 |
35 | <script src="boomerang.js" type="text/javascript"></script>
36 | <script src="dns.js" type="text/javascript"></script> <!-- concatenate with boomerang.js for better performance -->
37 | <script type="text/javascript">
38 | BOOMR.init({
39 | 		user_ip: "<user's ip address>",
40 | 		beacon_url: "http://yoursite.com/path/to/beacon.php",
41 | 		DNS: {                                         
42 | 		    base_url: "http://*.yoursite.com/images/"  
43 | 		}                                              
44 | 	});
45 | </script>
46 | 
47 | 48 |

49 | 正しく設定できれば、これで誤差範囲内で DNS の遅延が測定できるはずです。エラーを調べるためにテストを複数実行できますが、今のところ1回しか行ないません。 50 |

51 | 52 | 55 | 56 |

57 |

58 | 59 | 60 | 61 | 73 | 74 | 75 | -------------------------------------------------------------------------------- /doc/ja/howtos/howto-9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Boomerang 使用方法 #9: W3C Navigation Timing API からパフォーマンスデータを回収する 5 | 6 | 7 | 8 | 9 | ドキュメント一覧 | 使用方法一覧 10 |

Boomerang 使用方法 #9: W3C Navigation Timing API からパフォーマンスデータを回収する

11 |

12 | 注意:この Navigation Timing プラグインはまだテストされていません。テストに協力してくれる方を歓迎します。 13 |

14 | 15 |

W3C Navigation Timing API はページの読み込みのパフォーマンスデータを広く深く提供するモダンブラウザーに実装されているインターフェースです。これを書いている時点では次のブラウザーがサポートしています:

16 | 17 | 22 | 23 |

navtiming.js プラグインは設定のオプションを必要とせず、ブラウザー(がサポートしていれば)の値からデータをシンプルに取得し、それらをビーコンのクエリーに追加します。

24 | 25 |

でフォルトのプラグインではないため、あなた自身で boomerang.js をビルドする必要があります。これを行うには、次のオプションを指定して boomerang のディレクトリーで make を実行してください:

26 | 27 |
28 | make PLUGINS=navtiming.js
29 | 
30 | 31 |

そうすると新しい boomerang のファイル(好きな JavaScript 圧縮ツールに通すことを忘れないでください)をあなたが通常使うものにできます。

32 | 33 |

新しいクエリーパラメーターとブラウザーの属性は次のように対応しています。それぞれの属性ごとの定義は W3C Navigation Timing 仕様 をご覧ください。

34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 |
ビーコンパラメーターNavigation Timing 属性
nt_red_cntwindow.performance.navigation.redirectCount
nt_nav_typewindow.performance.navigation.type
nt_nav_stwindow.performance.timing.navigationStart
nt_red_stwindow.performance.timing.redirectStart
nt_red_endwindow.performance.timing.redirectEnd
nt_fet_stwindow.performance.timing.fetchStart
nt_dns_stwindow.performance.timing.domainLookupStart
nt_dns_endwindow.performance.timing.domainLookupEnd
nt_con_stwindow.performance.timing.connectStart
nt_con_endwindow.performance.timing.connectEnd
nt_req_stwindow.performance.timing.requestStart
nt_res_stwindow.performance.timing.responseStart
nt_res_endwindow.performance.timing.responseEnd
nt_domloadingwindow.performance.timing.domLoading
nt_domintwindow.performance.timing.domInteractive
nt_domcontloadedwindow.performance.timing.domContentLoaded
nt_domcompwindow.performance.timing.domComplete
nt_load_stwindow.performance.timing.loadEventStart
nt_load_endwindow.performance.timing.loadEventEnd
nt_unload_stwindow.performance.timing.unloadEventStart
nt_unload_endwindow.performance.timing.unloadEventEnd
62 | 63 | 66 | 67 |

68 |

69 | 70 | 71 | 72 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /doc/ja/howtos/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 使用方法一覧 6 | 7 | 8 | 9 | ドキュメント一覧 10 |

どのようにして boomerang を使うか

11 |

12 | 以下は ユースケース の中であげられている項目です。 13 |

14 |

使用方法

15 | 29 | 30 |

TODO

31 | 36 | 37 | 40 | 41 | 42 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /doc/ja/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | this, is boomerang 6 | 7 | 10 | 16 | 17 | 21 | 22 | 23 | English 24 |

this, is boomerang

25 |

26 | ブーメランは必ずもどってくる、何かにぶつからない限り。 27 |

28 |

ブーメラン?

29 |

30 | boomerang は小さな JavaScript からなり、あなたのウェブページに埋め込まれ、ユーザーの視点からあなたのウェブページのパフォーマンスを測定する場となります。さらに解析するには取得したデータをあなたのサーバーに送信する必要があります。boomerang を使えば、ユーザーがあなたのサイトがどれくらい速度で見ているかを正確に知ることができます。 31 |

32 |

33 | boomerang は BSD ライセンス のもとでオープンソースとして公開されています。我々は boomerang に関する多くのドキュメントを提供します。 34 |

35 |

使い方

36 | 45 |

開発元

46 |

47 | boomerang は Yahoo! Developer Network の協力のもと Yahoo! の Exceptional Performance チームにより開発されています。 48 |

49 |

ソースコード

50 | 54 | 55 | 69 | 70 | 71 | 75 | -------------------------------------------------------------------------------- /doc/ja/methodology.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Boomerang の測定方法 6 | 7 | 8 | 9 | ドキュメント一覧 10 |

どのように動作するか

11 | 12 |

1. 往復測定(Round trip)

13 |

14 | 私たちはユーザーがリソースにリクエストを始めてから、そのリソースがユーザーにとって完全に有効になるまでの時間を往復(round trip)時間として定義します。私たちが測定できるものは HTML ページのリソースでなおかつ、私たちがコントロールできるページ上からのクリックまたは画面遷移によってリクエストされたリソースに限ります。 15 |

16 |

17 | 往復時間はしたがって、リンクをユーザーがクリックしてからユーザーによってページが参照されるまでの時間となります。多くの場合、これは前のページの onbeforeunload イベントが発生してから現在のページの onload イベントが発生するまでを測定すれば問題ありません。いくつかのケースでは違うかもしれませんが、私たちはこれらのイベントを開発者が決められるようにします。 18 |

19 |

20 | どのように測定するか。 21 |

22 | 46 | 47 | 48 | 49 |

2. 帯域幅と遅延の測定

50 |

51 | 帯域幅と遅延はサーバー上の固定サイズの画像のダウンロードとそれらをダウンロードするためにかかった時間によって測定します。次のようにして実行します: 52 |

53 | 79 | 80 | 83 | 84 |
85 |

注釈:

86 |
    87 |
  1. 88 | 実際はこの時点で中断しますが、自分で設定した開始時間によって補助できるような機能があります。これは全ページの読み込み時間を測定していないときにはとても便利ですが、いくつかの読み込み時間は JavaScript による動的なものかもしれません。 89 |
  2. 90 |
  3. 91 | この時点では中断しないようにできる機能を用意していますが、むしろバックエンドに全ての URL を渡して、ビーコンを破棄するかどうかをサーバー側で決められるようにしています。これは SSL 上のログイン画面があるサイトでは便利ですし、ユーザーがリンクをクリックしてログイン画面へ遷移する場合も考えられます。このケースではリファラーがあるかもしれないし、ないかもしれません。 92 |
  4. 93 |
  5. 94 | この値は BW.nruns パラメーターを使って設定できます。boomerang の詳しい設定は Howto #6 をご覧ください。 95 |
  6. 96 |
  7. 97 | 帯域幅のテストは15秒後にタイムアウトします。この時点で既に集めたデータをもとに帯域幅を決めます。 98 |
  8. 99 |
100 |
101 | 102 | 103 | 107 | -------------------------------------------------------------------------------- /doc/ja/press.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | boomerang 最新情報 6 | 7 | 8 | 9 | ドキュメント一覧 10 |

boomerang についての発表資料

11 |

12 | これは boomerang について発表された私たちが把握している資料の一覧です。もしあなたが書いた資料やここにない資料をご存知でしたら、この一覧に追加するので私たちに教えてください。 13 |

14 | 25 | 26 | 27 | 28 | 32 | -------------------------------------------------------------------------------- /doc/ja/use-cases.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | boomerang のユースケース 6 | 7 | 8 | 9 | ドキュメント一覧 10 |

boomerang のユースケース

11 |

12 | これらは boomerang を使用できるいくつかの方法です。これはライブラリーが実際に全てのユースケースをサポートしているかの確認に役立ちます。 13 |

14 | 15 |

1. ページの体感的なパフォーマンスを測定する

16 |

17 | 私たちはユーザーがページを読み込むために要した時間を計測する手段を必要としています。通常これはユーザーがリンクをクリック(またはブラウザーに URL を入力)してからページが使用可能になるまでの時間を指します。 18 |

19 |

20 | リンクがあなたのコントロールできる領域にあればクリックされた時間を記録するのは簡単ですが、ユーザーがブラウザーに URL を入力して Enter キーを押したときの正確な時間を伝えるのは簡単ではありません。そこで私たちがコントロールできるページ上のリンクのクリックに注力します。 21 |

22 |

23 | ページが使用可能になる時間が分からないことのうちの一つになります。ほとんどのページではこれは onload イベントが発生した時点となりますが、実際にはページが使用可能となる前に onload イベントが発生する(例えば、多くのコンテンツが JavaScript によって読み込まれている)可能性もあります。また、onload イベントが発生する前にページが使用可能となる(例えば、隠されたリソースがページ下部に埋め込まれた JavaScript によって読み込まれる)場合もあります。これらのどちらのケースにおいても、ページの開発者は自分のページが利用可能になる時のより良いアイデアを持ち、自分のライブラリーにこのイベントを発生させられるようにすべきです。 24 |

25 |

26 | これを4つのユースケースに切り分けます: 27 |

28 | 29 |
    30 |
  1. ユーザーが私たちがコントロールできるページのリンクをクリックし onload イベントが発生したときにページが使用可能となる
    31 | 使用方法 #1a をご覧ください
  2. 32 | 33 |
  3. ユーザーが私たちがコントロールできるページのリンクをクリックし開発者が決めた任意のポイントによってページが使用可能となる
    34 | 使用方法 #1b をご覧ください
  4. 35 | 36 |
  5. ユーザーが URL を入力したりブックマークや私たちがコントロールできないページをクリックし onload イベントが発生したときにページが使用可能となる
    37 | これは最近では WebTiming API をサポートしているブラウザー(例えば、IE9)では可能ですが、その他のブラウザーでは動きません。
    38 | TODO #2 をご覧ください
  6. 39 | 40 |
  7. ユーザーが URL を入力したりブックマークや私たちがコントロールできないページをクリックし開発者が決めた任意のポイントによってページが使用可能となる
    41 | これは最近では WebTiming API をサポートしているブラウザー(例えば、IE9)では可能ですが、その他のブラウザーでは動きません。
    42 | TODO #2 をご覧ください
  8. 43 |
44 | 45 | 46 |

2. 動的に読み込まれたコンテンツの体感的なパフォーマンスを測定する

47 |

48 | 多くのウェブサイトは動的にコンテンツを読み込むことがあります。例えば、スライドショーに使う画像やタブを使ったコンテンツは JavaScript を通して読み込まれます。証券相場では定期的に XHR を使ってバックエンドのウェブサービスから自らリフレッシュする場合がありますし、ウェブメールサービスは JavaScript を使ってサーバーに新しいメッセージを確認したり選択されたメッセージをダウンロードしたりします、などなど。 49 |

50 |

51 | これら全てのケースでブラウザーはダウンロードが開始されたとき、また完了したときのイベントを発生させることができません。開発者が必要なときに呼び出せるようなメソッドやイベントをライブラリーは公開する必要があります。 52 |

53 |

54 | 使用方法 #2 をご覧ください。 55 |

56 | 57 |

3. ページの読み込み時間を加えたユーザーの回線帯域幅を測定する

58 |

59 | ユーザーは様々なインターネット接続を使ってウェブを参照するため、全てのユーザーの統計学的な数値を表すために複数のユーザーのページの読み込み時間を常に集めることはできません。しかしユーザーの回線帯域幅を知っていることから、似たようなユーザーからデータを集め、ネットワーク接続のタイプごとにユーザーの統計的な数値として使用できます。 60 |

61 |

62 | 使用方法 #3 をご覧ください。 63 |

64 | 65 | 66 |

4. より正確な読み込み時間を測定する

67 |

68 | 多くのウェブサイトは異なるバックエンドサービスから読み込まれる別々のコンポーネントによって構成されていることがあります。例えば私のホームページには dopplr、upcoming、twitter、delicious、flickr といったウィジェットがあります。今ではページ全体の読み込み時間が重要であり、これこそがユーザーにはページのパフォーマンスとして認識されます。これはページ全体の測定の一部にすぎませんが、便利で各コンポーネントの個別の読み込み時間を測定するためにも有益です。つまりこれはページの読み込み時間を各コンポーネントの読み込み時間に切り分けることを可能にし、ページ内の各コンポーネントの分析を行ないます。 69 |

70 |

71 | これを行うには開発者がライブラリーを使ってページにタイマーを追加できるようになっている必要があります。これらのタイマーはページ全体の読み込みとともにビーコンを送る必要があります。 72 |

73 |

74 | 使用方法 #4 をご覧ください。 75 |

76 | 77 | 78 |

5. HTTP の遅延を測定する

79 |

80 | ネットワークの遅延はページのダウンロード時間が大きな要因です。それは TCP 接続を確立し、HTTP リクエストを生成するいくつかのパケットを必要とするため、HTTP の遅延は単純な ping よりも高くなってしまいます。また HTTP リクエストと実際のページのコンテンツに関係のないレスポンスヘッダーがオーバーヘッドに関係します。 81 |

82 |

83 | ユーザーの HTTP の遅延を測定することはページ全体の並列化されたコンポーネントのダウンロードが与える影響の良い指標を提供してくれます。 84 |

85 |

86 | 使用方法 #3 をご覧ください。 87 |

88 | 89 | 90 |

6. リクエストとページにタグをつける

91 |

92 | パフォーマンスの解析をしているとき、それは2つ以上のデザインの異なるページのパフォーマンスを比較する A/B テストを行うときに便利です。 93 | これらのページには同じ URL があるかもしれないため、その一連のテストからページを識別しビーコンのデータをもとに必要なときにいくつかの情報が追加されます。 94 |

95 |

96 | ライブラリーは追加情報を各ページにタグをつける機能を開発者に提供するべきです。 97 |

98 |

99 | 使用方法 #5 をご覧ください。 100 |

101 | 102 | 103 |

7. DNS の遅延を測定する

104 |

105 | DNS の遅延は DNS のリクエストを行うためにどれくらい時間がかかるかを教えてくれます。これは Web サーバーや DNS の設定、ユーザーの ISP の DNS サーバーがどのような構成になっているか、など様々な要因によって影響を受ける可能性があります。この遅延の測定で私たちは一つのページ上で安全にルックアップした多くのドメインの目安を得られます。これらは私たちがルックアップできる DNS の数と複数のドメインが私たちにもたらす並列性を交換することになります。HTTP の遅延と DNS の遅延は一緒にユーザーのためにこの点がどこにあるかを私たちに教えてくれます。 106 |

107 |

108 | 使用方法 #8 をご覧ください。 109 |

110 | 111 | 112 |

8. 全てのユーザーにかわるランダムなサンプルを測定する

113 |

114 | トラフィックが高いサイトの場合、全てのリクエストではなくランダムなサンプルだけ測定した方が便利です。私たちはサーバーサイドでランダムなサンプリングを行うことができ、一部のリクエストに JavaScript の提供だけします。また、私たちはサーバーを簡素化し、クライアントサイドでサンプリングできます。 115 |

116 |

117 | クライアントサイドのサンプリングはクライアント間で状況を共有しないためサーバーサイドのように正確にはなりませんが、私たちはランダムなサンプルは得ることができます。 118 |

119 |

120 | TODO #1 ご覧ください。 121 |

122 | 123 | 124 |

9. 不正なビーコンを防ぐ

125 |

126 | もしあなたの URL がある場合、それは故意または誤った使い方によって悪用される可能性があります。 127 |

128 |

129 | 例えば、あなたが満足するサイトのデザインを行い、パフォーマンスを測定するために boomerang の JavaScript を埋め込みます。JavaScript はあなたのサーバーにビーコンを送ります。あなたのデザインが本当に好きな誰かがサイトに訪問して、あなたの HTML をコピーして彼らは自分のサーバーにコピーします。彼らはテキストや画像を変えたりしますが、JavaScript はあなたのサーバーにビーコンをまだ送り続けます。あなたは彼らのビーコンを受け取ることになってしまううえに、これだけでもあなたのサーバーの負荷を増やし測定を台無しにしてしまいます。 130 |

131 |

132 | 次に可能性があるのはあなたのビーコンの URL を幼稚なスクリプトが見つけ、不当にあなたのサーバーを大量に叩き始め、何もなければ DoS 攻撃を試してくる場合もあります。 133 |

134 |

135 | boomerang はこれらの問題から守る必要があります。 136 |

137 |

138 | 使用方法 #7 をご覧ください。 139 |

140 | 141 |

10. ブラウザーの WebTiming 情報を回収する

142 |

143 | モダンブラウザーはページの読み込みに関する多くのパフォーマンス情報を取得できる Navigation Timing API をサポートしています。NavigationTiming プラグインはこの情報を回収し、ビーコンに追加します。 144 |

145 |

146 | 使用方法 #9 をご覧ください。 147 |

148 | 149 | 152 | 153 | 154 | 155 | 159 | -------------------------------------------------------------------------------- /doc/methodology.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Boomerang methodology 6 | 7 | 8 | 9 | All Docs 10 |

So how does this thing work?

11 | 12 |

1. Roundtrip measurements

13 |

14 | We define round trip time as the time taken from the user initiating a resource request 15 | to when that resource is completely available for the user to interact with. We limit 16 | our measurements only to HTML page type resources. 17 |

18 |

19 | The round trip time is therefore the time from the user clicking on a link to the page 20 | referenced by that link becoming usable by the user. For most cases, this is as good 21 | as measuring the time from the previous page's onbeforeunload event firing to the current 22 | page's onload event firing. In some cases this may be different, but we let the 23 | developer determine those events. 24 |

25 |

26 | This is how we measure. 27 |

28 | 64 | 65 | 66 | 67 |

2. Bandwidth & Latency measurements

68 |

69 | Bandwidth and latency are measured by downloading fixed size images from a server 70 | and measuring the time it took to download them. We run it in the following order: 71 |

72 | 110 | 111 | 114 | 115 |
116 |

Footnotes:

117 |
    118 |
  1. 119 | We don't actually abort at this point, but give the developer the ability to 120 | salvage the moment by setting his/her own start time. This is most useful when the 121 | developer isn't measuring full page load time, but possibly the load time of some 122 | dynamic content loaded via JavaScript. 123 |
  2. 124 |
  3. 125 | We offer the developer the ability to not abort at this point, but instead 126 | pass all URLs to the back end and let the server decide whether to discard the 127 | beacon or not. This is useful for sites that have a login page behind SSL and 128 | possibly redirect to the login page if the user clicks on certain links. In this 129 | case there might either be no referrer, or the referrer may not match. 130 |
  4. 131 |
  5. 132 | This value is configured using the BW.nruns parameter. See 133 | Howto #6 for details on configuring boomerang. 134 |
  6. 135 |
  7. 136 | The bandwidth test times out after 15 seconds. At that point it will try to 137 | determine the bandwidth based on data that it has already collected. 138 |
  8. 139 |
140 |
141 | 142 | 143 | 147 | -------------------------------------------------------------------------------- /doc/press.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | boomerang off the press 6 | 7 | 8 | 9 | All Docs 10 |

articles talking about boomerang

11 |

12 | This is a list of articles (that we are aware of) that speak about boomerang. If you write one, 13 | or know of one that isn't here, let us know, and we'll add it. 14 |

15 | 30 | 31 | 32 | 33 | 37 | -------------------------------------------------------------------------------- /images/image-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-0.png -------------------------------------------------------------------------------- /images/image-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-1.png -------------------------------------------------------------------------------- /images/image-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-2.png -------------------------------------------------------------------------------- /images/image-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-3.png -------------------------------------------------------------------------------- /images/image-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-4.png -------------------------------------------------------------------------------- /images/image-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-5.png -------------------------------------------------------------------------------- /images/image-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-6.png -------------------------------------------------------------------------------- /images/image-l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YahooArchive/boomerang/11ad90a22d25815775aba6b42a0ddab9c69df861/images/image-l.gif -------------------------------------------------------------------------------- /ipv6.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011, Yahoo! Inc. All rights reserved. 3 | * Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms. 4 | */ 5 | 6 | /** 7 | \file ipv6.js 8 | Plugin to measure various ipv6 related metrics. 9 | This plugin tries to do a few things: 10 | - Check if the client can connect to an ipv6 address 11 | - Check if the client can resolve DNS that points to an ipv6 address 12 | - Check latency of connecting to an ipv6 address 13 | - Check avg latency of doing dns lookup to an ipv6 address (not worstcase) 14 | 15 | You'll need a server that has an ipv6 address, and a DNS name to point to it. 16 | Additionally, this server needs to be configured to serve content requested 17 | from the IPv6 address and should not require a virtual host name. This means 18 | that you probably cannot use shared hosting that puts multiple hosts on the 19 | same IP address. 20 | 21 | All beacon parameters are prefixed with ipv6_ 22 | 23 | Beacon parameters: 24 | - ipv6_latency: Latency in milliseconds of getting data from an ipv6 host when 25 | connecting to the IP. Set to NA if the client cannot connect 26 | to the ipv6 host. 27 | - ipv6_lookup: Latency of getting data from a hostname that resolves to an 28 | ipv6 address. Set to NA if the client cannot resolve or connect 29 | to the ipv6 host. 30 | */ 31 | 32 | (function(w) { 33 | 34 | BOOMR = BOOMR || {}; 35 | BOOMR.plugins = BOOMR.plugins || {}; 36 | 37 | /* 38 | Algorithm: 39 | 40 | 1. Try to load a sizeless image from an IPv6 host 41 | - onerror, flag no IPv6 connect support and end 42 | - onload, measure load time 43 | 2. Try to load a sizeless image from a hostname that resolves to an IPv6 address 44 | - onerror, flag no IPv6 DNS resolver and end 45 | - onload, measure load time 46 | */ 47 | var impl = { 48 | complete: false, 49 | ipv6_url: "", 50 | host_url: "", 51 | timeout: 1200, 52 | 53 | timers: { 54 | ipv6: { start: null, end: null }, 55 | host: { start: null, end: null } 56 | }, 57 | 58 | start: function() { 59 | this.load_img('ipv6', 'host'); 60 | }, 61 | 62 | load_img: function() { 63 | var img, 64 | rnd = "?t=" + (new Date().getTime()) + Math.random(), 65 | timer=0, error = null, 66 | that = this, 67 | which = Array.prototype.shift.call(arguments), 68 | a = arguments; 69 | 70 | // Terminate if we've reached end of test list 71 | if(!which || !(which in this.timers)) { 72 | this.done(); 73 | return false; 74 | } 75 | 76 | // Skip if URL wasn't set for this test 77 | if(!this[which + '_url']) { 78 | return this.load_img.apply(this, a); 79 | } 80 | 81 | img = new Image(); 82 | 83 | img.onload = function() { 84 | that.timers[which].end = new Date().getTime(); 85 | clearTimeout(timer); 86 | img.onload = img.onerror = null; 87 | img = null; 88 | 89 | that.load_img.apply(that, a); 90 | that = a = null; 91 | }; 92 | 93 | error = function() { 94 | that.timers[which].supported = false; 95 | clearTimeout(timer); 96 | img.onload = img.onerror = null; 97 | img = null; 98 | 99 | that.done(); 100 | that = a = null; 101 | }; 102 | 103 | img.onerror = error; 104 | timer = setTimeout(error, this.timeout); 105 | this.timers[which].start = new Date().getTime(); 106 | img.src = this[which + '_url'] + rnd; 107 | 108 | return true; 109 | }, 110 | 111 | done: function() { 112 | if(this.complete) { 113 | return; 114 | } 115 | 116 | BOOMR.removeVar('ipv6_latency', 'ipv6_lookup'); 117 | if(this.timers.ipv6.end !== null) { 118 | BOOMR.addVar('ipv6_latency', this.timers.ipv6.end - this.timers.ipv6.start); 119 | } 120 | else { 121 | BOOMR.addVar('ipv6_latency', 'NA'); 122 | } 123 | 124 | if(this.timers.host.end !== null) { 125 | BOOMR.addVar('ipv6_lookup', this.timers.host.end - this.timers.host.start); 126 | } 127 | else { 128 | BOOMR.addVar('ipv6_lookup', 'NA'); 129 | } 130 | 131 | this.complete = true; 132 | BOOMR.sendBeacon(); 133 | } 134 | }; 135 | 136 | BOOMR.plugins.IPv6 = { 137 | init: function(config) { 138 | BOOMR.utils.pluginConfig(impl, config, "IPv6", ["ipv6_url", "host_url", "timeout"]); 139 | 140 | if(!impl.ipv6_url) { 141 | BOOMR.warn("IPv6.ipv6_url is not set. Cannot run IPv6 test.", "ipv6"); 142 | impl.complete = true; // set to true so that is_complete doesn't 143 | // block other plugins 144 | return this; 145 | } 146 | 147 | if(!impl.host_url) { 148 | BOOMR.warn("IPv6.host_url is not set. Will skip hostname test.", "ipv6"); 149 | } 150 | 151 | // make sure that test images use the same protocol as the host page 152 | if(w.location.protocol === 'https:') { 153 | impl.ipv6_url = impl.ipv6_url.replace(/^http:/, 'https:'); 154 | impl.host_url = impl.host_url.replace(/^http:/, 'https:'); 155 | } 156 | else { 157 | impl.ipv6_url = impl.ipv6_url.replace(/^https:/, 'http:'); 158 | impl.host_url = impl.host_url.replace(/^https:/, 'http:'); 159 | } 160 | 161 | BOOMR.subscribe("page_ready", impl.start, null, impl); 162 | 163 | return this; 164 | }, 165 | 166 | is_complete: function() { 167 | return impl.complete; 168 | } 169 | }; 170 | 171 | }(window)); 172 | 173 | -------------------------------------------------------------------------------- /navtiming.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Buddy Brewer. 3 | */ 4 | 5 | /** 6 | \file navtiming.js 7 | Plugin to collect metrics from the W3C Navigation Timing API. For more information about Navigation Timing, 8 | see: http://www.w3.org/TR/navigation-timing/ 9 | */ 10 | 11 | // w is the window object 12 | (function(w) { 13 | 14 | // First make sure BOOMR is actually defined. It's possible that your plugin is loaded before boomerang, in which case 15 | // you'll need this. 16 | BOOMR = BOOMR || {}; 17 | BOOMR.plugins = BOOMR.plugins || {}; 18 | 19 | // A private object to encapsulate all your implementation details 20 | var impl = { 21 | complete: false, 22 | done: function() { 23 | var p, pn, pt, data; 24 | p = w.performance || w.msPerformance || w.webkitPerformance || w.mozPerformance; 25 | if(p && p.timing && p.navigation) { 26 | BOOMR.info("This user agent supports NavigationTiming.", "nt"); 27 | pn = w.performance.navigation; 28 | pt = w.performance.timing; 29 | data = { 30 | nt_red_cnt: pn.redirectCount, 31 | nt_nav_type: pn.type, 32 | nt_nav_st: pt.navigationStart, 33 | nt_red_st: pt.redirectStart, 34 | nt_red_end: pt.redirectEnd, 35 | nt_fet_st: pt.fetchStart, 36 | nt_dns_st: pt.domainLookupStart, 37 | nt_dns_end: pt.domainLookupEnd, 38 | nt_con_st: pt.connectStart, 39 | nt_con_end: pt.connectEnd, 40 | nt_req_st: pt.requestStart, 41 | nt_res_st: pt.responseStart, 42 | nt_res_end: pt.responseEnd, 43 | nt_domloading: pt.domLoading, 44 | nt_domint: pt.domInteractive, 45 | nt_domcontloaded_st: pt.domContentLoadedEventStart, 46 | nt_domcontloaded_end: pt.domContentLoadedEventEnd, 47 | nt_domcomp: pt.domComplete, 48 | nt_load_st: pt.loadEventStart, 49 | nt_load_end: pt.loadEventEnd, 50 | nt_unload_st: pt.unloadEventStart, 51 | nt_unload_end: pt.unloadEventEnd 52 | }; 53 | if (pt.secureConnectionStart) { 54 | // secureConnectionStart is OPTIONAL in the spec 55 | data.nt_ssl_st = pt.secureConnectionStart; 56 | } 57 | BOOMR.addVar(data); 58 | } 59 | this.complete = true; 60 | BOOMR.sendBeacon(); 61 | } 62 | }; 63 | 64 | BOOMR.plugins.NavigationTiming = { 65 | init: function() { 66 | BOOMR.subscribe("page_ready", impl.done, null, impl); 67 | return this; 68 | }, 69 | 70 | is_complete: function() { 71 | return impl.complete; 72 | } 73 | }; 74 | 75 | }(window)); 76 | 77 | -------------------------------------------------------------------------------- /plugin.js: -------------------------------------------------------------------------------- 1 | /** 2 | \file plugin.js 3 | Skeleton template for all boomerang plugins. Use this code as a starting point for your 4 | own plugins. 5 | */ 6 | 7 | ////////////////////////////////////////////////////////// 8 | // DO NOT INCLUDE THIS FILE IN YOUR HTML DOCUMENT // 9 | // THIS IS A SAMPLE PLUGIN // 10 | ////////////////////////////////////////////////////////// 11 | 12 | // w is the window object 13 | (function(w) { 14 | 15 | var d=w.document; 16 | 17 | // First make sure BOOMR is actually defined. It's possible that your plugin is loaded before boomerang, in which case 18 | // you'll need this. 19 | BOOMR = BOOMR || {}; 20 | BOOMR.plugins = BOOMR.plugins || {}; 21 | 22 | // A private object to encapsulate all your implementation details 23 | // This is optional, but the way we recommend you do it. 24 | var impl = { 25 | }; 26 | 27 | BOOMR.plugins.MyPlugin = { 28 | init: function(config) { 29 | var i, properties = ["prop1", "prop2"]; // list of user configurable properties in O 30 | 31 | // This block is only needed if you actually have user configurable properties 32 | BOOMR.utils.pluginConfig(impl, config, "MyPlugin", properties); 33 | 34 | // Other initialisation code here 35 | 36 | // Subscribe to any BOOMR events here. 37 | // Unless your code will explicitly be called by the developer 38 | // or by another plugin, you must to do this. 39 | 40 | return this; 41 | }, 42 | 43 | // Any other public methods would be defined here 44 | 45 | is_complete: function() { 46 | // This method should determine if the plugin has completed doing what it 47 | /// needs to do and return true if so or false otherwise 48 | } 49 | }; 50 | 51 | }(window)); 52 | 53 | -------------------------------------------------------------------------------- /tests/1-basic.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This page should load without javascript errors.
6 | Status: PASS 7 | 14 | 15 | 16 | 17 | 21 | -------------------------------------------------------------------------------- /tests/2-init.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This page should load without javascript errors.
6 | This page calls init() with no parameters, so onload should fire and try to measure page performance.
7 | Status: PASS 8 | 9 | 16 | 17 | 20 | 21 | 22 | 26 | -------------------------------------------------------------------------------- /tests/3-initparams.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This page should load without javascript errors.
6 | This page calls init() with a base_url for bandwidth images, so onload should fire and try to measure page performance and bandwidth.
7 | Status: PASS 8 | 9 | 16 | 17 | 20 | 21 | 22 | 26 | -------------------------------------------------------------------------------- /tests/4-event.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | This page should load without javascript errors.
6 | This page calls init() with a base_url for bandwidth images, so onload should fire and try to measure page performance and bandwidth.
7 | It subscribes to the before_beacon event, and should get data from that
8 | Status: PASS 9 | 10 | 17 | 18 | 22 | 23 | 24 | 28 | -------------------------------------------------------------------------------- /tests/index.html: -------------------------------------------------------------------------------- 1 | 7 | 8 | 11 | 15 | -------------------------------------------------------------------------------- /zzz_last_plugin.js: -------------------------------------------------------------------------------- 1 | BOOMR.t_end = new Date().getTime(); 2 | --------------------------------------------------------------------------------