record "blocked"
This commit is contained in:
parent
15414fb59e
commit
a14a7d2837
|
|
@ -302,6 +302,7 @@ export abstract class APIRequestContext extends SdkObject {
|
|||
const requestOptions = { ...options, agent };
|
||||
|
||||
const startAt = monotonicTime();
|
||||
let reusedSocketAt: number | undefined;
|
||||
let dnsLookupAt: number | undefined;
|
||||
let tcpConnectionAt: number | undefined;
|
||||
let tlsHandshakeAt: number | undefined;
|
||||
|
|
@ -330,6 +331,7 @@ export abstract class APIRequestContext extends SdkObject {
|
|||
};
|
||||
|
||||
if (request.reusedSocket) {
|
||||
timings.blocked = reusedSocketAt! - startAt;
|
||||
timings.connect = -1;
|
||||
timings.dns = -1;
|
||||
}
|
||||
|
|
@ -497,6 +499,7 @@ export abstract class APIRequestContext extends SdkObject {
|
|||
// happy eyeballs don't emit lookup and connect events, so we use our custom ones
|
||||
const happyEyeBallsTimings = timingForSocket(socket);
|
||||
if (request.reusedSocket) {
|
||||
reusedSocketAt = monotonicTime();
|
||||
dnsLookupAt = startAt;
|
||||
tcpConnectionAt = startAt;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -887,6 +887,7 @@ it('should not have connect and dns timings when socket is reused', async ({ con
|
|||
const request2 = log.entries[1];
|
||||
expect.soft(request2.timings.connect).toBe(-1);
|
||||
expect.soft(request2.timings.dns).toBe(-1);
|
||||
expect.soft(request2.timings.blocked).toBeGreaterThan(0);
|
||||
});
|
||||
|
||||
it('should include redirects from API request', async ({ contextFactory, server }, testInfo) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue