moved out timing defintions to the util file

This commit is contained in:
soulgalore 2014-06-23 21:54:41 +02:00
parent 5c8dae8d96
commit 22e7e3d829
1 changed files with 20 additions and 0 deletions

View File

@ -292,6 +292,26 @@ module.exports = {
return Object.keys(domains).length;
},
getTimingMetricsDefinition: function(timing) {
var descriptions = {};
descriptions.firstPaintTime = 'This is when the first paint happens on the screen, reported by the browser.';
descriptions.serverConnectionTime = 'How long time it takes to connect to the server. Definition: connectEnd - connectStart';
descriptions.domainLookupTime = 'The time it takes to do the DNS lookup. Definition: domainLookupEnd - domainLookupStart';
descriptions.pageLoadTime = 'The time it takes for page to load, from initiation of the pageview (e.g., click on a page link) to load completion in the browser. Important: this is only relevant to some pages, depending on how you page is built. Definition: loadEventStart - navigationStart';
descriptions.pageDownloadTime = 'How long time does it take to download the page (the HTML). Definition: responseEnd - responseStart';
descriptions.serverResponseTime = 'How long time does it take until the server respond. Definition: responseStart - requestStart';
descriptions.domContentLoadedTime = "The time the browser takes to parse the document and execute deferred and parser-inserted scripts including the network time from the user's location to your server. Definition: domContentLoadedEventStart - navigationStart";
descriptions.domInteractiveTime = "The time the browser takes to parse the document, including the network time from the user's location to your server. Definition: domInteractive - navigationStart";
descriptions.redirectionTime = 'Time spent on redirects. Definition: fetchStart - navigationStart';
descriptions.backEndTime = 'The time it takes for the network and the server to generate and start sending the HTML. Definition: responseStart - navigationStart';
descriptions.frontEndTime = 'The time it takes for the browser to parse and create the page. Definition: loadEventStart - responseEnd';
if (descriptions.hasOwnProperty(timing))
return descriptions[timing];
else return 'Measurement using the User Timing API';
},
/**
* Get the size in bytes for a specific domain
*/