README.md in wbench-0.4.0 vs README.md in wbench-1.0.0

- old
+ new

@@ -21,10 +21,22 @@ ```bash $ brew install chromedriver ``` +If you are not using Homebrew on OSX, download the latest binary version of [chromedriver](http://chromedriver.storage.googleapis.com/index.html). +Then unpack the ZIP archive and copy the chromedriver binary to the /usr/bin directory: +```bash +$ sudo cp /location/of/chromedriver/binary /usr/bin +``` +Test that chromedriver is working by typing "chromedriver": +```bash +$ chromedriver +Starting ChromeDriver (v2.7.236836) on port 9515 +``` +Note that you will NOT need the chromedriver-utility gem if you install the binary in this manner. + Alternatively you can install firefox and use it with wbench. See [Running other browsers](#running-other-browsers) for more info. ## Usage ### Command Line @@ -50,10 +62,21 @@ ```bash $ wbench -u "Mozilla/5.0 (iPhone; U; ..." https://www.desktoppr.co/ ``` +### Color output + +By default the output will be in color. Piping the results to another process +should correctly remove the coloring. If your terminal doesn't output color, or +you're getting funny symbols in your results then you can remove color from the +output using the `-c` flag. + +```bash +$ wbench -c https://www.desktoppr.co/ +``` + ### Server performance measuring Server response times will be reported if the application is a ruby/rack application that returns the `X-Runtime` http header. Without that header the server performance will not be able to be measured. ### Ruby API @@ -126,9 +149,23 @@ Please note that by visiting pages before each run, your browser may cache some assets. This means that when the benchmark is run against the authenticated page, some assets may be loaded from the cache, and the result may appear quicker than an uncahed visit. + + +### Custom event timings + +Custom events are available to instrument through wbench. To do so use the native HTML5 function `window.performance.mark` like so: + +```javascript +if(typeof(window.performance) === 'object' && typeof(window.performance.mark) == 'function') { + window.performance.mark('my custom event'); +} +``` + +You can use the `onload` event handler to call the JavaScript above to instrument when certain elements (images for example) are loaded. Currently this only works in google chrome, so we need to protect against the function not being available. + ### Gisting results You can install the [Github gist gem](https://github.com/defunkt/gist) and pipe in the results of wbench