From 73e0732706194032b93e40652087fccf8eb0104b Mon Sep 17 00:00:00 2001 From: soulgalore Date: Tue, 26 Aug 2014 22:42:37 +0200 Subject: [PATCH] new switch for fetching navtiming with phantomjs --- lib/analyze/analyzer.js | 2 +- lib/analyze/phantom.js | 2 +- lib/conf.js | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/analyze/analyzer.js b/lib/analyze/analyzer.js index 9b867d332..84d6ad980 100644 --- a/lib/analyze/analyzer.js +++ b/lib/analyze/analyzer.js @@ -33,7 +33,7 @@ Analyzer.prototype.analyze = function(urls, collector, downloadErrors, analysisE } }, function(cb) { - if (config.runYslow) { + if (config.phantomjs) { phantomjs.analyze(urls, cb); } else { cb(undefined, {}); diff --git a/lib/analyze/phantom.js b/lib/analyze/phantom.js index 028c3a505..258ee82fe 100644 --- a/lib/analyze/phantom.js +++ b/lib/analyze/phantom.js @@ -30,7 +30,7 @@ module.exports = { } else { var queue = async.queue(phantomjs, config.threads); - + var errors = {}; var pageData = {}; urls.forEach(function(u) { diff --git a/lib/conf.js b/lib/conf.js index b0b35b138..2a513e4ae 100644 --- a/lib/conf.js +++ b/lib/conf.js @@ -265,6 +265,10 @@ config = require('nomnom').options({ flag: true, help: 'Set to true to turn of collecting metrics using YSlow.', }, + phantomjs: { + flag: true, + help: 'Set to true to turn fetch Navigation Timing metrics using PhantomJS. Needs PhantomJS 2.0', + }, wptLocation: { metavar: '', help: 'WebPageTest location, something like Dulles:Chrome ',