browsertime 3.0

This commit is contained in:
soulgalore 2018-05-10 11:02:51 +02:00
parent 5b12ea1a37
commit b0c7fd0447
9 changed files with 61 additions and 50 deletions

View File

@ -1 +1 @@
2.5.0
3.0.0

View File

@ -1,4 +1,4 @@
bin/browsertime.js [options] <url>
browsertime.js [options] <url>
timeouts
--timeouts.browserStart Timeout when waiting for browser to start, in milliseconds [number] [default: 60000]
@ -10,15 +10,14 @@ chrome
--chrome.args Extra command line arguments to pass to the Chrome process (e.g. --no-sandbox). To add multiple arguments to Chrome, repeat --chrome.args once per argument.
--chrome.binaryPath Path to custom Chrome binary (e.g. Chrome Canary). On OS X, the path should be to the binary inside the app bundle, e.g. "/Applications/Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary"
--chrome.chromedriverPath Path to custom Chromedriver binary. Make sure to use a Chromedriver version that's compatible with the version of Chrome you're using
--chrome.mobileEmulation.deviceName Name of device to emulate. Works only standalone (see list in Chrome DevTools, but add phone like 'iPhone 6')
--chrome.mobileEmulation.deviceName Name of device to emulate. Works only standalone (see list in Chrome DevTools, but add phone like 'iPhone 6'). This will override your userAgent string.
--chrome.mobileEmulation.width Width in pixels of emulated mobile screen (e.g. 360) [number]
--chrome.mobileEmulation.height Height in pixels of emulated mobile screen (e.g. 640) [number]
--chrome.mobileEmulation.pixelRatio Pixel ratio of emulated mobile screen (e.g. 2.0)
--chrome.android.package Run Chrome on your Android device. Set to com.android.chrome for default Chrome version. You need to run adb start-server before you start.
--chrome.android.deviceSerial Choose which device to use. If you do not set it, first device will be used.
--chrome.collectTracingEvents Include Tracing events in the performance log (implies chrome.collectPerfLog). [boolean]
--chrome.collectCPUMetrics Collect CPU metrics. You need to have Python installed + collect the devtools.timeline for this to work. [boolean]
--chrome.traceCategories A comma separated list of Tracing event categories to include in the performance log (implies chrome.collectTracingEvents). [string]
--chrome.traceCategories A comma separated list of Tracing event categories to include in the Trace log. Default no trace categories is collected. [string]
--chrome.timeline Collect the timeline data. Drag and drop the JSON in your Chrome detvools timeline panel or check out the CPU metrics in the Browsertime.json [boolean]
--chrome.collectPerfLog Collect performance log from Chrome with Page and Network events and save to disk. [boolean]
--chrome.collectNetLog Collect network log from Chrome and save to disk. [boolean]
--chrome.collectConsoleLog Collect Chromes console log and save to disk. [boolean]
@ -29,8 +28,9 @@ firefox
--firefox.beta Use Firefox Beta. Works on OS X. For Linux you need to set the binary path. [boolean]
--firefox.developer Use Firefox Developer. Works on OS X. For Linux you need to set the binary path. [boolean]
--firefox.preference Extra command line arguments to pass Firefox preferences by the format key:value To add multiple preferences, repeat --firefox.preference once per argument.
--firefox.includeResponseBodies Include response bodies in HAR [boolean]
--firefox.includeResponseBodies Include response bodies in HAR [choices: "none", "all", "html"] [default: "none"]
--firefox.acceptInsecureCerts Accept insecure certs [boolean]
--firefox.collectMozLog Collect the MOZ HTTP log [boolean]
selenium
--selenium.url URL to a running Selenium server (e.g. to run a browser on another machine).
@ -44,6 +44,14 @@ video
--videoParams.filmstripQuality The quality of the filmstrip screenshots. 0-100. [default: 75]
--videoParams.createFilmstrip Create filmstrip screenshots. [boolean] [default: true]
--videoParams.combine Combine preScript/postScript with the tested URL in the video. Turn this on and you will record the all scripts. [boolean] [default: false]
--videoParams.nice Use nice when running FFMPEG during the run. A value from -20 to 19 https://linux.die.net/man/1/nice [default: 0]
Screenshot
--screenshot Save one screen shot per iteration. [boolean] [default: false]
--screenshotParams.type Set the file type of the screenshot [choices: "png", "jpg"] [default: "jpg"]
--screenshotParams.png.compressionLevel zlib compression level [default: 6]
--screenshotParams.jpg.quality Quality of the JPEG screenshot. 1-100 [default: 80]
--screenshotParams.maxSize The max size of the screenshot (width and height). [default: 2000]
proxy
--proxy.http Http proxy (host:port) [string]
@ -59,35 +67,39 @@ connectivity
--connectivity.throttle.localhost Add latency/delay on localhost. Perfect for testing with WebPageReplay [boolean] [default: false]
Options:
--video Record a video and store the video. Set it to false to remove the video that is created by turning on speedIndex. Requires FFMpeg to be installed. [boolean]
--speedIndex Calculate SpeedIndex. Requires FFMpeg and python dependencies [boolean]
--browser, -b Specify browser [choices: "chrome", "firefox"] [default: "chrome"]
--screenshot Save one screen shot per iteration. [boolean]
--pageCompleteCheck Supply a Javascript that decides when the browser is finished loading the page and can start to collect metrics. The Javascript snippet is repeatedly queried to see if page has completed loading (indicated by the script returning true). Use it to fetch timings happening after the loadEventEnd.
--iterations, -n Number of times to test the url (restarting the browser between each test) [number] [default: 3]
--prettyPrint Enable to print json/har with spaces and indentation. Larger files, but easier on the eye. [boolean] [default: false]
--delay Delay between runs, in milliseconds [number] [default: 0]
--requestheader, -r Request header that will be added to the request. Add multiple instances to add multiple request headers. Use the following format key:value
--block Domain to block. Add multiple instances to add multiple domains that will be blocked.
--cacheClearRaw Use internal browser functionality to clear browser cache between runs instead of only using Selenium. [boolean] [default: false]
--basicAuth Use it if your server is behind Basic Auth. Format: username@password (Only Chrome at the moment).
--preScript Selenium script(s) to run before you test your URL (use it for login, warm the cache, etc). Note that --preScript can be passed multiple times.
--postScript Selenium script(s) to run after you test your URL (use it for logout etc). Note that --postScript can be passed multiple times.
--script Add custom Javascript to run after the page has finished loading to collect metrics. If a single js file is specified, it will be included in the category named "custom" in the output json. Pass a folder to include all .js scripts in the folder, and have the folder name be the category. Note that --script can be passed multiple times.
--userAgent Override user agent
--silent, -q Only output info in the logs, not to the console. Enter twice to suppress summary line. [count]
--output, -o Specify file name for Browsertime data (ex: 'browsertime'). Unless specified, file will be named browsertime.json
--har Specify file name for .har file (ex: 'browsertime'). Unless specified, file will be named browsertime.har
--skipHar Pass --skipHar to not collect a HAR file. [boolean]
--config Path to JSON config file
--viewPort Size of browser window WIDTHxHEIGHT or "maximize". Note that "maximize" is ignored for xvfb.
--resultDir Set result directory for the files produced by Browsertime
--xvfb Start xvfb before the browser is started [boolean] [default: false]
--xvfbParams.display The display used for xvfb [default: 99]
--preURL A URL that will be accessed first by the browser before the URL that you wanna analyze. Use it to fill the cache.
--preURLDelay Delay between preURL and the URL you want to test (in milliseconds) [default: 1500]
--userTimingWhitelist All userTimings are captured by default this option takes a regex that will whitelist which userTimings to capture in the results.
--headless Run the browser in headless mode. Needs Firefox Nightly or latest Chrome. [boolean] [default: false]
-h, --help Show help [boolean]
-V, --version Show version number [boolean]
--video Record a video and store the video. Set it to false to remove the video that is created by turning on visualMetrics. To remove fully turn off video recordings, make sure to set video and visualMetrics to false. Requires FFMpeg to be installed. [boolean]
--visualMetrics Collect Visual Metrics like First Visual Change, SpeedIndex, Perceptual Speed Index and Last Visual Change. Requires FFMpeg and Python dependencies [boolean]
--browser, -b Specify browser [choices: "chrome", "firefox"] [default: "chrome"]
--pageCompleteCheck Supply a JavaScript that decides when the browser is finished loading the page and can start to collect metrics. The JavaScript snippet is repeatedly queried to see if page has completed loading (indicated by the script returning true). Use it to fetch timings happening after the loadEventEnd. By default the tests ends 2 seconds after loadEventEnd. Also checkout --pageCompleteCheckInactivity
--pageCompleteCheckInactivity Alternative way to choose when to end your test. This will wait for 2 seconds of inactivity that happens after loadEventEnd. [boolean] [default: false]
--iterations, -n Number of times to test the url (restarting the browser between each test) [number] [default: 3]
--prettyPrint Enable to print json/har with spaces and indentation. Larger files, but easier on the eye. [boolean] [default: false]
--delay Delay between runs, in milliseconds [number] [default: 0]
--requestheader, -r Request header that will be added to the request. Add multiple instances to add multiple request headers. Use the following format key:value
--block Domain to block. Add multiple instances to add multiple domains that will be blocked.
--percentiles The percentile values within the data browsertime will calculate and report. [array] [default: [0,10,90,99,100]]
--decimals The decimal points browsertime statistics round to. [number] [default: 0]
--cacheClearRaw Use internal browser functionality to clear browser cache between runs instead of only using Selenium. [boolean] [default: false]
--basicAuth Use it if your server is behind Basic Auth. Format: username@password (Only Chrome at the moment).
--preScript Selenium script(s) to run before you test your URL (use it for login, warm the cache, etc). Note that --preScript can be passed multiple times.
--postScript Selenium script(s) to run after you test your URL (use it for logout etc). Note that --postScript can be passed multiple times.
--script Add custom Javascript to run after the page has finished loading to collect metrics. If a single js file is specified, it will be included in the category named "custom" in the output json. Pass a folder to include all .js scripts in the folder, and have the folder name be the category. Note that --script can be passed multiple times.
--userAgent Override user agent
--silent, -q Only output info in the logs, not to the console. Enter twice to suppress summary line. [count]
--output, -o Specify file name for Browsertime data (ex: 'browsertime'). Unless specified, file will be named browsertime.json
--har Specify file name for .har file (ex: 'browsertime'). Unless specified, file will be named browsertime.har
--skipHar Pass --skipHar to not collect a HAR file. [boolean]
--gzipHar Pass --gzipHar to gzip the HAR file [boolean]
--config Path to JSON config file
--viewPort Size of browser window WIDTHxHEIGHT or "maximize". Note that "maximize" is ignored for xvfb.
--resultDir Set result directory for the files produced by Browsertime
--xvfb Start xvfb before the browser is started [boolean] [default: false]
--xvfbParams.display The display used for xvfb [default: 99]
--preURL A URL that will be accessed first by the browser before the URL that you wanna analyze. Use it to fill the cache.
--preURLDelay Delay between preURL and the URL you want to test (in milliseconds) [default: 1500]
--userTimingWhitelist All userTimings are captured by default this option takes a regex that will whitelist which userTimings to capture in the results.
--headless Run the browser in headless mode. [boolean] [default: false]
--extension Path to a WebExtension to be installed in the browser. Note that --extension can be passed multiple times.
-h, --help Show help [boolean]
-V, --version Show version number [boolean]

View File

@ -23,7 +23,7 @@ twitterdescription:
Use our Docker image (with Chrome, Firefox, XVFB and the dependencies needed to record a video):
~~~bash
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime:{% include version/browsertime.txt %} --video --speedIndex https://www.sitespeed.io/
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime:{% include version/browsertime.txt %} --video --visualMetrics https://www.sitespeed.io/
~~~
Or using NodeJS:
@ -52,7 +52,7 @@ docker build -t sitespeedio/browsertime .
And then just run it:
~~~bash
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime -n 1 --video --speedIndex https://www.sitespeed.io/
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime -n 1 --video --visualMetrics https://www.sitespeed.io/
~~~
## Connectivity
@ -70,5 +70,5 @@ The current version doesn't support Docker so you need to [install the requireme
If you want to set connectivity you need to use something like [Pi Network Conditioner](https://github.com/phuedx/pinc).
~~~bash
browsertime --browsertime.chrome.android.package com.android.chrome https://www.sitespeed.io --video --speedIndex
browsertime --browsertime.chrome.android.package com.android.chrome https://www.sitespeed.io --video --visualMetrics
~~~

View File

@ -16,7 +16,7 @@ The easiest way to send metrics is to install [jq](https://stedolan.github.io/jq
First you just run Browsertime. Here make sure we create the *browsertime.json* in a directory called tmp.
~~~bash
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime:{% include version/browsertime.txt %} --video --speedIndex --resultDir tmp https://www.sitespeed.io/ -n 5
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime-results sitespeedio/browsertime:{% include version/browsertime.txt %} --video --visualMetrics --resultDir tmp https://www.sitespeed.io/ -n 5
~~~
Then we pickup the median SpeedIndex from Browsertime and send it to your Graphite instance.

View File

@ -1,6 +1,6 @@
---
layout: default
title: Documentation browsertime 6.x
title: Documentation Browsertime 3
description: Read about all you can do with Browsertime.
keywords: tools, documentation, web performance
nav: documentation

View File

@ -21,12 +21,12 @@ You can run Browsertime using our Docker container or using NodeJS.
## Docker
We have [Docker images](https://hub.docker.com/r/sitespeedio/browsertime/) with Browsertime, Chrome, Firefox and Xvfb. It is super easy to use (Xvfb is started automatically when you start the container). Here's how to use the container with both Firefox 54 & Chrome (install [Docker](https://docs.docker.com/engine/installation/) first).
We have [Docker images](https://hub.docker.com/r/sitespeedio/browsertime/) with Browsertime, Chrome, Firefox and Xvfb. It is super easy to use (Xvfb is started automatically when you start the container). Here's how to use the container with both Firefox & Chrome (install [Docker](https://docs.docker.com/engine/installation/) first).
### Mac & Linux
~~~bash
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime sitespeedio/browsertime:{% include version/browsertime.txt %} --video --speedIndex https://www.sitespeed.io/
docker run --shm-size=1g --rm -v "$(pwd)":/browsertime sitespeedio/browsertime:{% include version/browsertime.txt %} --video --visualMetrics https://www.sitespeed.io/
~~~
### Windows

View File

@ -42,7 +42,6 @@ To understand how Browsertime does these things, let's talk about how it works.
5. When the page is finished loading (you can define yourself when that happens), Browsertime executes the default JavaScript timing metrics and collects:
- [Navigation Timing metrics](http://kaaes.github.io/timing/info.html)
- [User Timing metrics](http://www.html5rocks.com/en/tutorials/webperformance/usertiming/)
- [Resource Timing data](http://www.w3.org/TR/resource-timing/)
- First paint
- [RUM Speed Index](https://github.com/WPO-Foundation/RUM-SpeedIndex).
6. It also collects a [HAR](http://www.softwareishard.com/blog/har-12-spec/) file that shows all requests/responses on the page.

6
package-lock.json generated
View File

@ -551,9 +551,9 @@
"integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8="
},
"browsertime": {
"version": "3.0.0-beta.2",
"resolved": "https://registry.npmjs.org/browsertime/-/browsertime-3.0.0-beta.2.tgz",
"integrity": "sha512-vqAq4aqMb+/B7SEJhkdVLGzbxdgy5c8ncOaBmtVtDKsslPbwT2jBkfS+NHQcidMgLKlhNonmPuIBA0sT2SIADg==",
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/browsertime/-/browsertime-3.0.0.tgz",
"integrity": "sha512-rbR8J3j0e8QyWwl4kP2W9yWHitP5UdoHwnLWu3j2ozVd3osxWL0UawOimJSyE3oZoH69xRBxh+cE36ke1OokGg==",
"requires": {
"@sitespeed.io/throttle": "0.3.0",
"adbkit": "2.11.0",

View File

@ -72,7 +72,7 @@
"dependencies": {
"aws-sdk": "2.222.1",
"bluebird": "3.5.1",
"browsertime": "3.0.0-beta.2",
"browsertime": "3.0.0",
"cli-color": "1.2.0",
"concurrent-queue": "7.0.2",
"fast-stats": "0.0.3",