simplified creation of wpt metric #546

This commit is contained in:
soulgalore 2015-01-14 22:39:54 +01:00
parent 9095c21739
commit a986973df4
36 changed files with 161 additions and 585 deletions

View File

@ -0,0 +1,13 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('TTFBWPT',
'TTFB',
'Time To First Byte (fetched using WebPageTest)',
'timing', 'milliseconds', 0,
'TTFB');

View File

@ -0,0 +1,13 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('bytesWPT',
'Size',
'The size in bytes', 'pagemetric', 'bytes', 0,
'bytesIn'
);

View File

@ -0,0 +1,13 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('firstPaintWPT',
'First Paint',
'The first paint time (fetched using WebPageTest)',
'timing', 'milliseconds', 0,
'firstPaint');

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewBytesWPT',
'Size First View',
'The size in bytes for the first view', 'pagemetric', 'bytes', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.bytesIn);
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewFirstPaintWPT',
'First Paint First View',
'The first paint time (fetched using WebPageTest)', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.firstPaint);
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewImageSavingsWPT',
'Image Savings First View',
'How much that can be saved if the images are compressed (fetched using WebPageTest)', 'pagemetric', 'bytes', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.image_savings); // jshint ignore:line
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewImageTotalWPT',
'Image Size First View',
'Total image size (fetched using WebPageTest)', 'pagemetric', 'bytes', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.image_total); // jshint ignore:line
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewLoadTimeWPT',
'Load Time First View',
'The Load Time', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.loadTime);
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewRenderWPT',
'Render First View',
'Render time (fetched using WebPageTest)', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.render);
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewRequestsWPT',
'Requests First View',
'The number of requests for the first view', 'pagemetric', '', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.requests);
});
});
}
});

View File

@ -1,20 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewServerRTTWPT', 'Round Trip Time',
'Estimated Server Round Trip Time', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.server_rtt); // jshint ignore:line
});
});
}
});

View File

@ -1,22 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewSpeedIndexWPT',
'Speed Index First View',
'The Speed Index is the average time at which visible parts of the page are displayed. It is expressed in milliseconds and dependent on size of the view port. (fetched using WebPageTest)',
'timing', '', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.SpeedIndex);
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewTTFBWPT',
'TTFB First View',
'Time To First Byte (fetched using WebPageTest)', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.TTFB);
});
});
}
});

View File

@ -1,55 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Stats = require('fast-stats').Stats;
var util = require('../../util/util');
var userTimings = {};
// The aggregator id is used to print error messages. A better design for 'dynamic' aggregators is needed,
// but this will do for now.
exports.id = 'wptFirstViewMetrics';
exports.processPage = function(pageData) {
if (pageData.webpagetest) {
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (run.firstView.results.userTimes) {
Object.keys(run.firstView.results.userTimes).forEach(function(userTiming) {
if (userTimings.hasOwnProperty(userTiming)) {
userTimings[userTiming].push(Number(run.firstView.results.userTimes[userTiming]));
} else {
userTimings[userTiming] = new Stats().push(Number(run.firstView.results.userTimes[
userTiming]));
}
});
}
});
});
}
};
exports.generateResults = function() {
var keys = Object.keys(userTimings),
result = [];
for (var i = 0; i < keys.length; i++) {
result.push({
id: 'firstView' + keys[i] + 'WPT',
title: keys[i] + ' first view',
desc: 'User Timing API metric',
type: 'timing',
stats: util.getStatisticsObject(userTimings[keys[i]], 0),
unit: 'milliseconds'
});
}
return result;
};
exports.clear = function() {
userTimings = {};
};

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewVisualCompleteWPT',
'Visual Complete First View',
'Time of the last visual change to the page (fetched using WebPageTest).', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.firstView.results.visualComplete);
});
});
}
});

View File

@ -0,0 +1,14 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('imageSavingsWPT',
'Image Savings',
'How much that can be saved if the images are compressed (fetched using WebPageTest)',
'pagemetric', 'bytes', 0,
'image_savings'
);

View File

@ -0,0 +1,14 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('imageTotalWPT',
'Image Size',
'Total image size (fetched using WebPageTest)', 'pagemetric',
'bytes', 0,
'image_total'
);

View File

@ -0,0 +1,12 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('loadTimeWPT',
'Load Time',
'The Load Time', 'timing',
'milliseconds', 0, 'loadTime');

View File

@ -0,0 +1,13 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('renderWPT',
'Render',
'Render time (fetched using WebPageTest)',
'timing', 'milliseconds', 0,
'render');

View File

@ -1,23 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewBytesWPT',
'Size Repeat View',
'The size in bytes for the repeat view', 'pagemetric', 'bytes', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (typeof run.repeatView !== 'undefined') {
stats.push(run.repeatView.results.bytesIn);
}
});
});
}
});

View File

@ -1,23 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewFirstPaintWPT',
'First Paint Repeat View',
'The first paint time (fetched using WebPageTest)', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (typeof run.repeatView !== 'undefined') {
stats.push(run.repeatView.results.firstPaint);
}
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewImageSavingsWPT',
'Image Savings Repeat View',
'How much that can be saved if the images are compressed (fetched using WebPageTest)', 'pagemetric', 'bytes', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.repeatView.results.image_savings); // jshint ignore:line
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewImageTotalWPT',
'Image Size Repeat View',
'Total image size (fetched using WebPageTest)', 'pagemetric', 'bytes', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.repeatView.results.image_total); // jshint ignore:line
});
});
}
});

View File

@ -1,23 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewLoadTimeWPT',
'Load Time Repeat View',
'The Load Time', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (typeof run.repeatView !== 'undefined') {
stats.push(run.repeatView.results.loadTime);
}
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewRenderWPT',
'Render Repeat View',
'Render time (fetched using WebPageTest)', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.repeatView.results.render);
});
});
}
});

View File

@ -1,23 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewRequestsWPT',
'Requests Repeat View',
'The number of requests for the repeat view', 'pagemetric', '', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (typeof run.repeatView !== 'undefined') {
stats.push(run.repeatView.results.requests);
}
});
});
}
});

View File

@ -1,20 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewServerRTTWPT', 'Round Trip Time',
'Estimated Server Round Trip Time', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.repeatView.results.server_rtt); // jshint ignore:line
});
});
}
});

View File

@ -1,24 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewSpeedIndexWPT',
'Speed Index Repeat View',
'The Speed Index is the average time at which visible parts of the page are displayed. It is expressed in milliseconds and dependent on size of the view port. (fetched using WebPageTest)',
'timing', '', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (typeof run.repeatView !== 'undefined') {
stats.push(run.repeatView.results.SpeedIndex);
}
});
});
}
});

View File

@ -1,21 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewTTFBWPT',
'TTFB Repeat View',
'Time To First Byte (fetched using WebPageTest)', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
stats.push(run.repeatView.results.TTFB);
});
});
}
});

View File

@ -1,56 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Stats = require('fast-stats').Stats;
var util = require('../../util/util');
var userTimings = {};
// The aggregator id is used to print error messages. A better design for 'dynamic' aggregators is needed,
// but this will do for now.
exports.id = 'wptRepeatViewMetrics';
exports.processPage = function(pageData) {
if (pageData.webpagetest) {
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (run.repeatView.results.userTimes) {
Object.keys(run.repeatView.results.userTimes).forEach(function(userTiming) {
if (userTimings.hasOwnProperty(userTiming)) {
userTimings[userTiming].push(Number(run.repeatView.results.userTimes[userTiming]));
} else {
userTimings[userTiming] = new Stats().push(Number(run.repeatView.results.userTimes[
userTiming]));
}
});
}
});
});
}
};
exports.generateResults = function() {
var keys = Object.keys(userTimings),
result = [];
for (var i = 0; i < keys.length; i++) {
result.push({
id: 'repeatView' + keys[i] + 'WPT',
title: keys[i] + ' repeat view',
desc: 'User Timing API metric',
type: 'timing',
stats: util.getStatisticsObject(userTimings[keys[i]], 0),
unit: 'milliseconds'
});
}
return result;
};
exports.clear = function() {
userTimings = {};
};

View File

@ -1,23 +0,0 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewVisualCompleteWPT',
'Visual Complete Repeat View',
'Time of the last visual change to the page (fetched using WebPageTest).', 'timing', 'milliseconds', 0,
function(pageData) {
if (pageData.webpagetest) {
var stats = this.stats;
pageData.webpagetest.wpt.forEach(function(browserAndLocation) {
browserAndLocation.response.data.run.forEach(function(run) {
if (typeof run.repeatView !== 'undefined') {
stats.push(run.repeatView.results.visualComplete);
}
});
});
}
});

View File

@ -0,0 +1,13 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('requestsWPT',
'Requests',
'The number of requests',
'pagemetric', '', 0,
'requests');

View File

@ -0,0 +1,13 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('serverRTTWPT',
'Round Trip Time',
'Estimated Server Round Trip Time',
'timing', 'milliseconds', 0,
'server_rtt');

View File

@ -0,0 +1,12 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('speedIndexWPT',
'Speed Index',
'The Speed Index is the average time at which visible parts of the page are displayed. It is expressed in milliseconds and dependent on size of the view port. (fetched using WebPageTest)',
'timing', '', 0,'SpeedIndex');

View File

@ -0,0 +1,18 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var Stats = require('fast-stats').Stats;
var util = require('../../util/util');
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('userTiming',
'userTiming',
'User Timing API metric', 'timing', 'milliseconds', 0,
// special hack for telling the WPTAggregator to fetch
// all the user timings
'USERTIMING'
);

View File

@ -0,0 +1,13 @@
/**
* Sitespeed.io - How speedy is your site? (http://www.sitespeed.io)
* Copyright (c) 2014, Peter Hedenskog, Tobias Lidskog
* and other contributors
* Released under the Apache 2.0 License
*/
var WPTAggregator = require('../WPTAggregator');
module.exports = new WPTAggregator('visualCompleteWPT',
'Visual Complete',
'Time of the last visual change to the page (fetched using WebPageTest).',
'timing', 'milliseconds', 0,
'visualComplete');