Minor style nits.

This commit is contained in:
Tobias Lidskog 2017-04-30 08:49:09 +02:00
parent 2682a38eab
commit 33c91eef88
5 changed files with 12 additions and 14 deletions

View File

@ -19,7 +19,7 @@ module.exports = {
if (browsertimeRunData.timings[timing]) {
statsHelpers.pushGroupStats(this.statsPerType, this.groups[group], timing, browsertimeRunData.timings[timing]);
}
})
});
forEach(browsertimeRunData.timings.navigationTiming, (value, name) => {
statsHelpers.pushGroupStats(this.statsPerType, this.groups[group], ['navigationTiming', name], value);

View File

@ -32,7 +32,7 @@ module.exports = {
// we only sends individual groups to Graphite, not the
// total of all groups (you can calculate that yourself)
if (message.group === 'total') {
if (message.group === 'total') {
return;
}

View File

@ -62,8 +62,6 @@ module.exports = {
for (let key of Object.keys(flattenMess)) {
this.metrics[message.type + '.' + key] = 1;
}
} else {
return
}
},
close() {

View File

@ -28,7 +28,7 @@ module.exports = {
const options = clone(wptOptions);
return wptClient.runTestAsync(urlOrScript, options)
.then(function(data) {
var id = data.data.id;
const id = data.data.id;
log.info('Got ' + url + ' analysed from ' + options.host);
log.verbose('Got JSON from WebPageTest :%:2j', data);
@ -48,7 +48,7 @@ module.exports = {
}
views.forEach(function(view) {
for (var j = 1; j < wptOptions.runs + 1; j++) {
for (let j = 1; j < wptOptions.runs + 1; j++) {
// The WPT API wrapper mutates the options object, why ohh why?!?!?!
const screenShotOptions = {
run: j,
@ -64,12 +64,12 @@ module.exports = {
run: j,
chartType: 'connection',
repeatView: view === 'repeatView'
}
};
const timelineOptions = {
run: j,
repeatView: view === 'repeatView'
}
};
promises.push(
Promise.join(wptClient.getScreenshotImageAsync(id, screenShotOptions), j, view,
@ -81,7 +81,7 @@ module.exports = {
Promise.join(wptClient.getWaterfallImageAsync(id, waterfallOptions), j, view,
(result, index, view) => {
return storageManager.writeDataForUrl(result, 'wpt-waterfall-' + index + '-' + view + '.png', url,
'waterfall').catch(WPTAPIError, (error) => log.error('Couldnt get waterfall %s',error))
'waterfall').catch(WPTAPIError, (error) => log.error('Couldnt get waterfall %s',error))
})
);
@ -101,12 +101,12 @@ module.exports = {
}
}
})
});
return Promise.all(promises).then(() => {
const myResult = {
data: data.data,
har
}
};
myResult.trace = traces;
return myResult;
})

View File

@ -17,11 +17,11 @@ module.exports = {
}
},
getURLAndGroup(options, group, url, includeQueryParams) {
if(group && options.urlsMetaData && options.urlsMetaData[url] && options.urlsMetaData[url].alias) {
if (group && options.urlsMetaData && options.urlsMetaData[url] && options.urlsMetaData[url].alias) {
let alias = options.urlsMetaData[url].alias;
return this.toSafeKey(group) + "." + this.toSafeKey(alias);
return this.toSafeKey(group) + "." + this.toSafeKey(alias);
} else {
return flatten.keypathFromUrl(url, includeQueryParams);
}
}
}
};