Trace cold request waterfalls and isolate the layout discovery regression
This commit is contained in:
@@ -47,6 +47,7 @@ export function categorizeContentType(contentType, urlPath) {
|
||||
*/
|
||||
export function createThrottleProxy({ targetPort, profile = 'lte' }) {
|
||||
let activeTracking = false;
|
||||
let trackingStart = 0;
|
||||
let requestCount = 0;
|
||||
let requests = [];
|
||||
let totalWireBytes = 0;
|
||||
@@ -79,6 +80,7 @@ export function createThrottleProxy({ targetPort, profile = 'lte' }) {
|
||||
return;
|
||||
}
|
||||
|
||||
const requestStart = Date.now();
|
||||
reqIndex++;
|
||||
const currentReqIndex = reqIndex;
|
||||
|
||||
@@ -114,7 +116,8 @@ export function createThrottleProxy({ targetPort, profile = 'lte' }) {
|
||||
let recorded;
|
||||
if (activeTracking) {
|
||||
requestCount++;
|
||||
recorded={url:clientReq.url,status:upRes.statusCode,bytes:0};
|
||||
recorded={url:clientReq.url,status:upRes.statusCode,bytes:0,index:currentReqIndex,startMs:requestStart-trackingStart,headersMs:Date.now()-trackingStart};
|
||||
clientRes.once('finish',()=>{recorded.endMs=Date.now()-trackingStart;});
|
||||
requests.push(recorded);
|
||||
}
|
||||
|
||||
@@ -176,6 +179,7 @@ export function createThrottleProxy({ targetPort, profile = 'lte' }) {
|
||||
server.close(resolve);
|
||||
}),
|
||||
startTracking: () => {
|
||||
trackingStart = Date.now();
|
||||
activeTracking = true;
|
||||
},
|
||||
stopTracking: () => {
|
||||
|
||||
Reference in New Issue
Block a user