cleanup (moved aggregator to own dir)

This commit is contained in:
soulgalore 2014-11-03 00:28:46 +01:00
parent a918c42486
commit bcba68d57d
49 changed files with 97 additions and 97 deletions

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var Stats = require('fast-stats').Stats;
var util = require('./util/util');
var util = require('../util/util');
/**
* Create a aggregator that collects and aggregates statistics from web pages.
@ -46,4 +46,4 @@ Aggregator.prototype.clear = function() {
this.stats.reset();
};
module.exports = Aggregator;
module.exports = Aggregator;

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator'),
var Aggregator = require('../aggregator'),
log = require('winston');
module.exports = new Aggregator('requestsGPSI', 'Number of requests per page (gpsi)',
@ -19,4 +19,4 @@ module.exports = new Aggregator('requestsGPSI', 'Number of requests per page (gp
log.log('error', 'Non existing pageStats for ' + pageData.gpsi.id);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('scoreGPSI', 'Google Page Speed Insights Score',
'The score calculated by our friends at Google.', 'rule',
@ -13,4 +13,4 @@ module.exports = new Aggregator('scoreGPSI', 'Google Page Speed Insights Score',
if (pageData.gpsi) {
this.stats.push(pageData.gpsi.score);
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewBytesWPT',
'Size First View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewBytesWPT',
stats.push(run.firstView.results.bytesIn);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewFirstPaintWPT',
'First Paint First View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewFirstPaintWPT',
stats.push(run.firstView.results.firstPaint);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewLoadTimeWPT',
'Load Time First View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewLoadTimeWPT',
stats.push(run.firstView.results.loadTime);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewRequestsWPT',
'Requests First View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewRequestsWPT',
stats.push(run.firstView.results.requests);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewSpeedIndexWPT',
'Speed Index First View',
@ -17,4 +17,4 @@ module.exports = new Aggregator('firstViewSpeedIndexWPT',
stats.push(run.firstView.results.SpeedIndex);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewTTFBWPT',
'TTFB First View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewTTFBWPT',
stats.push(run.firstView.results.TTFB);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewVisualCompleteWPT',
'Visual Complete First View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewVisualCompleteWPT',
stats.push(run.firstView.results.visualComplete);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('imageSavingsWPT',
'Image Savings',
@ -16,4 +16,4 @@ module.exports = new Aggregator('imageSavingsWPT',
stats.push(run.firstView.results.image_savings); // jshint ignore:line
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('imageTotalWPT',
'Image size',
@ -16,4 +16,4 @@ module.exports = new Aggregator('imageTotalWPT',
stats.push(run.firstView.results.image_total); // jshint ignore:line
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewBytesWPT',
'Size Repeat View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewBytesWPT',
stats.push(run.repeatView.results.bytesIn);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewFirstPaintWPT',
'First Paint Repeat View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('repeatViewFirstPaintWPT',
stats.push(run.repeatView.results.firstPaint);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewLoadTimeWPT',
'Load Time Repeat View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('repeatViewLoadTimeWPT',
stats.push(run.repeatView.results.loadTime);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('firstViewRequestsWPT',
'Requests Repeat View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('firstViewRequestsWPT',
stats.push(run.repeatView.results.requests);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewSpeedIndexWPT',
'Speed Index Repeat View',
@ -17,4 +17,4 @@ module.exports = new Aggregator('repeatViewSpeedIndexWPT',
stats.push(run.repeatView.results.SpeedIndex);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('repeatViewVisualCompleteWPT',
'Visual Complete Repeat View',
@ -16,4 +16,4 @@ module.exports = new Aggregator('repeatViewVisualCompleteWPT',
stats.push(run.repeatView.results.visualComplete);
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('serverRTTWPT',
'Estimated Server Round Trip Time', 'timing', 'milliseconds',
@ -16,4 +16,4 @@ module.exports = new Aggregator('serverRTTWPT',
stats.push(run.firstView.results.server_rtt); // jshint ignore:line
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('browserScaledImages',
'Images scaled by the browser',
@ -18,4 +18,4 @@ module.exports = new Aggregator('browserScaledImages',
this.stats.push(0);
}
}
});
});

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var util = require('../../util/yslowUtil');
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('cacheTime', 'Cache Time',
'How long time the assets are cached in the browser. Long time is good.',
@ -17,4 +17,4 @@ module.exports = new Aggregator('cacheTime', 'Cache Time',
self.stats.push(util.getCacheTime(comp));
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('criticalPathScore',
'Critical Rendering Path Score',
@ -16,4 +16,4 @@ module.exports = new Aggregator('criticalPathScore',
this.stats.push(pageData.yslow.g.criticalpath.score);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('cssImagesPerPage',
'Number of CSS images per page',
@ -18,4 +18,4 @@ module.exports = new Aggregator('cssImagesPerPage',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('cssPerPage', 'Number of CSS files per page',
'Few larger files are better when using HTTP 1.1. For HTTP 2.0 it is better with many small files from few domains.',
@ -17,4 +17,4 @@ module.exports = new Aggregator('cssPerPage', 'Number of CSS files per page',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('cssWeight', 'CSS Weight',
'The weight of CSS is important, because of mobile and networks, keep the size to a minimal.',
@ -21,4 +21,4 @@ module.exports = new Aggregator('cssWeight', 'CSS Weight',
}
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('cssWeightPerPage', 'CSS File Weight Per Page',
'Do not download large front-end CSS farmework when you only use small parts of it.',
@ -22,4 +22,4 @@ module.exports = new Aggregator('cssWeightPerPage', 'CSS File Weight Per Page',
});
this.stats.push(size);
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('docWeight', 'Document Weight',
'Keep the document at a reasonable size, it will make it possible for the browser to generate the page faster.',
@ -21,4 +21,4 @@ module.exports = new Aggregator('docWeight', 'Document Weight',
}
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('domElements', 'Number of DOM elements',
'Too many DOM elements means that the page is complex and will be slower to render',
@ -17,4 +17,4 @@ module.exports = new Aggregator('domElements', 'Number of DOM elements',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('fontsPerPage', 'Number of font files per page',
'Few larger files are better when using HTTP 1.1. For HTTP 2.0 it is better with many small files from few domains.',
@ -17,4 +17,4 @@ module.exports = new Aggregator('fontsPerPage', 'Number of font files per page',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('imagesPerPage', 'Number of images per page',
'Avoid too many images because it will take time for them all to load.',
@ -17,4 +17,4 @@ module.exports = new Aggregator('imagesPerPage', 'Number of images per page',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('imageWeight', 'Image Weight',
'The weight of images is important, are usually 60-70% of the total page weight ',
@ -21,4 +21,4 @@ module.exports = new Aggregator('imageWeight', 'Image Weight',
}
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('imagesWeightPerPage', 'Images Weight Per Page',
'Image weight are the largest part of a web page. Make sure they are compressed and as small as possible.',
@ -22,4 +22,4 @@ module.exports = new Aggregator('imagesWeightPerPage', 'Images Weight Per Page',
});
this.stats.push(size);
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('jsPerPage', 'Number of JS files per page',
'Few larger files are better when using HTTP 1.1. For HTTP 2.0 it is better with many small files from few domains.',
@ -17,4 +17,4 @@ module.exports = new Aggregator('jsPerPage', 'Number of JS files per page',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('jsSyncInHead',
'Number of JS synchronously inside head',
@ -18,4 +18,4 @@ module.exports = new Aggregator('jsSyncInHead',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('jsWeight', 'JS Weight',
'The weight of javascripts is important, because of mobile and networks, keep the size to a minimal.',
@ -21,4 +21,4 @@ module.exports = new Aggregator('jsWeight', 'JS Weight',
}
});
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('jsWeightPerPage', 'JS File Weight Per Page',
'Don\'t download large Javascript libraries when you only use small parts of it.',
@ -22,4 +22,4 @@ module.exports = new Aggregator('jsWeightPerPage', 'JS File Weight Per Page',
});
this.stats.push(size);
}
});
});

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var util = require('../../util/yslowUtil');
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('maxRequestsPerHost', 'Max requests per domain',
'Using HTTP 1.1 you want to avoid loading too many assets from one domain',
@ -24,4 +24,4 @@ module.exports = new Aggregator('maxRequestsPerHost', 'Max requests per domain',
}
this.stats.push(maxRequestsPerHost);
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('noDuplicates', 'Remove duplicate JS and CSS',
'It is bad practice include the same js or css twice since browsers will execute the code each toim',
@ -18,4 +18,4 @@ module.exports = new Aggregator('noDuplicates', 'Remove duplicate JS and CSS',
}
}
});
});

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var util = require('../../util/yslowUtil');
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('numberOfDomains', 'Number Of Domains',
'Many domains means many DNS lookups and that means slower pages.',
@ -14,4 +14,4 @@ module.exports = new Aggregator('numberOfDomains', 'Number Of Domains',
if (pageData.yslow) {
this.stats.push(util.getNumberOfDomains(pageData.yslow.comps));
}
});
});

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var util = require('../../util/yslowUtil');
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('pageWeight',
'Total page weight (including all assets)',
@ -15,4 +15,4 @@ module.exports = new Aggregator('pageWeight',
if (pageData.yslow) {
this.stats.push(util.getSize(pageData.yslow.comps));
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('pagesWithSPOF', 'Pages with SPOF',
'How many pages have a single point of failures (meaning if someone elses API/site is broken, it will break your page.',
@ -17,4 +17,4 @@ module.exports = new Aggregator('pagesWithSPOF', 'Pages with SPOF',
this.stats.push(0);
}
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('redirectsPerPage', 'Redirects Per Page',
'Avoid doing redirects, it will slow down the page!',

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('requests', 'Number of requests per page',
'Fewer requests are always faster than many requests.',
@ -13,4 +13,4 @@ module.exports = new Aggregator('requests', 'Number of requests per page',
if (pageData.yslow) {
this.stats.push(pageData.yslow.r);
}
});
});

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var util = require('../../util/yslowUtil');
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('requestsWithoutExpires',
'Requests Without Expires',
@ -21,4 +21,4 @@ module.exports = new Aggregator('requestsWithoutExpires',
});
this.stats.push(requestsWithoutExpire);
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('requestsWithoutGzip', 'Requests without GZip',
'All text content (JS/CSS/HTML) can and should be sent GZiped so that the size is as small as possible.',
@ -18,4 +18,4 @@ module.exports = new Aggregator('requestsWithoutGzip', 'Requests without GZip',
}
}
});
});

View File

@ -1,4 +1,4 @@
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('ruleScore', 'Rule Score',
'The sitespeed.io total rule score for all the pages',
@ -7,4 +7,4 @@ module.exports = new Aggregator('ruleScore', 'Rule Score',
if (pageData.yslow) {
this.stats.push(pageData.yslow.o);
}
});
});

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var util = require('../../util/yslowUtil');
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('singleDomainRequests', 'Domains with only one request',
'Many domains means many DNS lookups and that means slower pages. Only loading one request for one domain is wasteful.',
@ -24,4 +24,4 @@ module.exports = new Aggregator('singleDomainRequests', 'Domains with only one r
}
this.stats.push(domainsWithOneRequest);
}
});
});

View File

@ -4,7 +4,7 @@
* and other contributors
* Released under the Apache 2.0 License
*/
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('spofPerPage',
'Number of SPOF per page',
@ -18,4 +18,4 @@ module.exports = new Aggregator('spofPerPage',
this.stats.push(0);
}
}
});
});

View File

@ -5,7 +5,7 @@
* Released under the Apache 2.0 License
*/
var util = require('../../util/yslowUtil');
var Aggregator = require('../../aggregator');
var Aggregator = require('../aggregator');
module.exports = new Aggregator('timeSinceLastMod',
'Time since last modification',
@ -18,4 +18,4 @@ module.exports = new Aggregator('timeSinceLastMod',
self.stats.push(util.getTimeSinceLastMod(comp));
});
}
});
});