Comparing version 2.2.2 to 2.3.0
# CHANGELOG - PageXray | ||
version 2.3.0 2018-05-12 | ||
------------------------ | ||
### Added | ||
* Count requests/size that happens after onContentLoad and onLoad. | ||
* Calculate fullyLoaded. | ||
version 2.2.2 2018-04-25 | ||
@@ -4,0 +10,0 @@ ------------------------ |
@@ -85,2 +85,11 @@ 'use strict'; | ||
// Summarize the timings for all pages | ||
const pageTimings = {}; | ||
for (let page of har.log.pages) { | ||
const pageStartTime = new Date(page.startedDateTime).getTime(); | ||
pageTimings[page.id] = { | ||
onLoad: pageStartTime + page.pageTimings.onLoad, | ||
onContentLoad: pageStartTime + page.pageTimings.onContentLoad | ||
}; | ||
} | ||
entries.forEach(entry => { | ||
@@ -107,2 +116,7 @@ if (!testedPages[entry.pageref]) { | ||
missingCompression: 0, | ||
fullyLoaded: util.getFullyLoaded( | ||
entry.pageref, | ||
entries, | ||
entry.startedDateTime | ||
), | ||
httpType: util.getConnectionType(httpVersion), | ||
@@ -124,3 +138,13 @@ httpVersion: util.getHTTPVersion(httpVersion), | ||
lastModifiedStats: new Statistics(), | ||
cookieStats: new Statistics() | ||
cookieStats: new Statistics(), | ||
afterOnContentLoad: { | ||
requests: 0, | ||
transferSize: 0, | ||
contentTypes: collect.defaultContentTypes() | ||
}, | ||
afterOnLoad: { | ||
requests: 0, | ||
transferSize: 0, | ||
contentTypes: collect.defaultContentTypes() | ||
} | ||
}; | ||
@@ -158,2 +182,13 @@ | ||
const entryStart = new Date(entry.startedDateTime).getTime(); | ||
if (entryStart > pageTimings[entry.pageref].onLoad) { | ||
currentPage.afterOnLoad.requests += 1; | ||
currentPage.afterOnLoad.transferSize += entry.response.bodySize; | ||
collect.contentType(asset, currentPage.afterOnLoad.contentTypes); | ||
} | ||
if (entryStart > pageTimings[entry.pageref].onContentLoad) { | ||
currentPage.afterOnContentLoad.requests += 1; | ||
currentPage.afterOnContentLoad.transferSize += entry.response.bodySize; | ||
collect.contentType(asset, currentPage.afterOnContentLoad.contentTypes); | ||
} | ||
// add first/third party info | ||
@@ -160,0 +195,0 @@ if (firstParty) { |
@@ -69,2 +69,26 @@ 'use strict'; | ||
/** | ||
* Get when the page is fully loaded | ||
* @param {Object} pageId | ||
* @param entries | ||
* @param {Object} pageStartDateTime | ||
*/ | ||
getFullyLoaded: (pageId, entries, pageStartDateTime) => { | ||
let pageEntries = Array.from(entries); | ||
pageEntries = Array.from( | ||
pageEntries.filter(entry => entry.pageref === pageId) | ||
); | ||
let pageEnd = 0; | ||
for (let entry of pageEntries) { | ||
let entryEnd = | ||
new Date(entry.startedDateTime).getTime() + | ||
entry.time - | ||
new Date(pageStartDateTime).getTime(); | ||
if (entryEnd > pageEnd) { | ||
pageEnd = entryEnd; | ||
} | ||
} | ||
return pageEnd; | ||
}, | ||
/** | ||
* Get main document requests (including redirects) for a HAR file. | ||
@@ -71,0 +95,0 @@ * @param entries |
{ | ||
"name": "pagexray", | ||
"version": "2.2.2", | ||
"version": "2.3.0", | ||
"description": "Xray your HAR file and know all about the page", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36078
684