Comparing version 0.4.0 to 0.5.0
@@ -10,2 +10,3 @@ const Promise = require('bluebird'); | ||
opts.sleep = opts.sleep || 0; | ||
opts.scroll = opts.scroll || false; | ||
if (!opts.url) { | ||
@@ -12,0 +13,0 @@ return Promise.reject(new Error('`url` option must be provided')); |
@@ -14,2 +14,7 @@ const wd = require('wd'); | ||
.then(() => { | ||
if (opts.scroll) { | ||
return session.execute('function f () { window.scrollBy(0,5); window.requestAnimationFrame(f); } window.requestAnimationFrame(f);'); | ||
} | ||
}) | ||
.then(() => { | ||
if (typeof opts.inject === 'function') { | ||
@@ -16,0 +21,0 @@ return opts.inject(session); |
@@ -5,7 +5,6 @@ const mean = require('lodash.meanby'); | ||
const timings = data.map((set) => { | ||
const start = set[0].message.message.params.timestamp; | ||
return { | ||
domcontentloaded: getEventTime('Page.domContentEventFired', set) - start, | ||
load: getEventTime('Page.loadEventFired', set) - start, | ||
render: getProfileTime('Paint', set) - start | ||
domcontentloaded: getEventTime('Page.domContentEventFired', set), | ||
load: getEventTime('Page.loadEventFired', set), | ||
render: getProfileTime('Paint', set) | ||
}; | ||
@@ -12,0 +11,0 @@ }); |
module.exports = { | ||
basic: require('./basic'), | ||
fps: require('./fps'), | ||
json: (data) => JSON.stringify(data, null, ' ') | ||
}; |
{ | ||
"name": "timeliner", | ||
"version": "0.4.0", | ||
"version": "0.5.0", | ||
"description": "Network Timeline Analyser", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -39,6 +39,14 @@ # timeliner | ||
*Optional* - set the nuber of times to load the page before aggregating results - Default `5` | ||
set the number of times to load the page before aggregating results - Default `5` | ||
### `reporter` | ||
*CLI only* - *Optional* - set the reporter to be used to output results - supported values: `basic`, `json` | ||
*CLI only* - set the reporter to be used to output results - supported values: `basic`, `fps`, `json` | ||
### `scroll` | ||
if set, injects a script into the page which binds a vertical scroll to `window.requestAnimationFrame` making the page scroll continuously - Default `false` | ||
### `sleep` | ||
set how long (in ms) after the page completes loading to continue recording metrics - Default `0` |
Sorry, the diff of this file is not supported yet
10687
18
211
52