forked from bluesmoon/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Documentation using JSDoc and Markdown + AutoXHR docs
* Add JSDoc support and build target to Gruntfile.js * Add JSDoc style documentation and migrate existing HTML documentation to markdown * Use SOASTA fork of jsdoc with disabled strict mode
- Loading branch information
1 parent
dd6d22d
commit a77714e
Showing
60 changed files
with
1,225 additions
and
783 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# this, is boomerang | ||
|
||
> boomerang always comes back, except when it hits something. | ||
## What? | ||
|
||
boomerang is a piece of javascript that you add to your web pages, where it measures | ||
the performance of your website from your end user's point of view. It has the ability | ||
to send this data back to your server for further analysis. With boomerang, you find | ||
out exactly how fast your users think your site is. | ||
|
||
boomerang is opensource and released under the BSD license, | ||
and we have a whole bunch of documentation about it. | ||
|
||
## How? | ||
|
||
- [Use Cases](tutorial-use-cases.html) -- Just some of the uses of boomerang that we can think of | ||
- [How it works](tutorial-methodology.html) -- A short description of how boomerang works internally | ||
- [Bugs, hugs and code](tutorial-community.html) -- This is where the community comes in | ||
- [TODO](tutorial-TODO.txt.html) -- There's a lot that we still need to do. Wanna help? | ||
- [Howto API Documentation](tutorial-howtos/index.html) -- Short recipes on how to do a bunch of things with boomerang | ||
- [API Documentation](tutorial-api/index.html) -- For all you hackers out there | ||
- [Press coverage](tutorial-press) -- A list of articles about boomerang | ||
|
||
boomerang comes to you from the [Exceptional Performance](http://developer.yahoo.com/performance/) | ||
team at [Yahoo!](http://www.yahoo.com/), aided by the [Yahoo! Developer Network](http://developer.yahoo.com/). | ||
|
||
## Where? | ||
|
||
- Get a zip or tarball from [github.com/lognormal/boomerang/archives/master](https://github.com/lognormal/boomerang/archives/master) | ||
- Get the working source code from [github.com/lognormal/boomerang](https://github.com/lognormal/boomerang) | ||
|
||
<!-- | ||
Copyright (c) 2011, Yahoo! Inc. All rights reserved. | ||
Copyright (c) 2012, Log-Normal, Inc. All rights reserved. | ||
Copyright (c) 2015, SOASTA, Inc. All rights reserved. | ||
Copyrights licensed under the BSD License. See the accompanying LICENSE.txt file for terms. | ||
--> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
AutoXHR - Instrument and measure AJAX requests and DOM manipulations triggering network requests | ||
|
||
With this plugin sites can not only monitor their page load but also the XMLHttpRequests after the page has been loaded | ||
as well as the DOM manipulations that trigger an asset to be fetched. | ||
|
||
### Configuring Boomerang with AutoXHR included | ||
|
||
You can enable the AutoXHR plugin with: | ||
|
||
```js | ||
BOOMR.init({ | ||
instrument_xhr: true | ||
}) | ||
``` | ||
|
||
Once this has been done and the site has been loaded and instrumented with this plugin, we have replaced the `XMLHttpRequest` object | ||
on the site with our very own! | ||
|
||
### Monitoring XHRs | ||
|
||
If you were to send an `XMLHttpRequest` on your page now you can see not only a page load beacon but also an XHR beacon: | ||
|
||
```js | ||
xhr = new XMLHttpRequest(); | ||
xhr.open("GET", "support/script200.js"); //200, async | ||
xhr.send(null); | ||
``` | ||
|
||
If you have boomerang with the auto_xhr.js plugin included in your page and someone visited the page, we are able | ||
to measure the time this asset takes to come down from the server. Measured performance data will include: | ||
|
||
- `u`: the URL of the image that has been fetched | ||
- `http.initiator`: The type of Beacon or Request that has been triggered in this case `xhr` | ||
|
||
### Using AutoXHR to monitor DOM events | ||
|
||
Say for example that you have button on the page that will insert a new picture, we can monitor this asset coming down and | ||
send timing information for that page: | ||
|
||
```html | ||
<script type="text/javascript"> | ||
(function(w, d) { | ||
var imageHolder = d.getElementById("picture"); | ||
var clickable = d.getElementById("clickable"); | ||
function clickCb() { | ||
var imageElement = d.createElement("img"); | ||
imageElement.src = "support/img.jpg"; | ||
imageHolder.appendChild(imageElement); | ||
} | ||
function addEvent(element, event, funct){ | ||
if (element.attachEvent) { | ||
return element.attachEvent("on"+event, funct); | ||
} | ||
else { | ||
return element.addEventListener(event, funct); | ||
} | ||
} | ||
addEvent(clickable, "mouseup", clickCb); | ||
}(this, this.document)); | ||
</script> | ||
|
||
<div id="clickable">Click Me!</div> | ||
<div id="picture"></div> | ||
``` | ||
|
||
### Before Page Load XHR Beacons | ||
|
||
By default AutoXHR will wait until the pages page load beacon has been sent to enable itself to start sending beacons that will correspond with the pages | ||
XHRs. If you wish to enable AutoXHR Beacons sending before the site itself has loaded, you can set a config flag for the AutoXHR plugin to enable it to | ||
send beacons as soon as it has instrumented the page. | ||
|
||
``` | ||
BOOMR.init({ | ||
instrument_xhr: true, | ||
AutoXHR: { | ||
alwaysSendXhr: true | ||
} | ||
}) | ||
``` | ||
|
||
### Compatibility and Browser Support | ||
|
||
Currently supported Browsers and platforms that AutoXHR will work on: | ||
|
||
- IE 9+ (not in quirks mode) | ||
- Chrome 38+ | ||
- Firefox 25+ | ||
|
||
In general we support all browsers that support `MutationObserver`, `XMLHttpRequest` with `addEventListener` on the XMLHttpRequest instance | ||
|
||
|
Oops, something went wrong.