-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: set opaque on request #560
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ describe('options.timing.test.ts', () => { | |
assert(res.timing.contentDownload > 0); | ||
assert(res.timing.contentDownload > res.timing.waiting); | ||
assert(res.timing.contentDownload <= res.rt); | ||
assert(res.socket.handledResponses === 1); | ||
assert.equal(res.socket.handledResponses, 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add assertions for dnslookup timing. While the assertion changes improve precision, consider adding assertions for the newly added Add these assertions after the existing timing checks: assert(res.timing.queuing > 0);
+assert(res.timing.dnslookup >= 0);
assert(res.timing.connected > 0); Also applies to: 48-48, 54-54 |
||
|
||
// again connected should be zero | ||
await sleep(1); | ||
|
@@ -45,13 +45,14 @@ describe('options.timing.test.ts', () => { | |
res = response.res as RawResponseWithMeta; | ||
assert(res.timing.waiting > 0); | ||
assert(res.timing.queuing > 0); | ||
assert(res.timing.connected === 0); | ||
assert.equal(res.timing.connected, 0); | ||
assert(res.timing.requestHeadersSent > 0); | ||
assert(res.timing.requestSent > 0); | ||
assert(res.timing.contentDownload > 0); | ||
assert(res.timing.contentDownload > res.timing.waiting); | ||
assert(res.timing.contentDownload <= res.rt); | ||
assert(res.socket.handledResponses === 2); | ||
assert.equal(res.socket.handledResponses, 2); | ||
// console.log(res.timing); | ||
}); | ||
|
||
it('should timing = false work', async () => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Based on the search results, I can now generate the final response:
DNS lookup timing metric is not properly implemented
While the
dnslookup
property is added to theTiming
type, there's no actual implementation to measure and set this value. The codebase shows:performance.now()
HttpAgent.ts
using thelookup
functionThe following locations need attention:
src/HttpAgent.ts
: Add timing measurement around the DNS lookup operationsrc/fetch.ts
andsrc/HttpClient.ts
: Ensure the DNS lookup timing is properly propagated🔗 Analysis chain
Verify dnslookup timing implementation.
The
dnslookup
timing property has been properly added to theTiming
type. Its position in the interface correctly reflects the chronological order of HTTP request phases.Let me gather more information to verify the timing implementation.
Let me try one more search pattern to find the timing implementation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1593
Script:
Length of output: 141
Script:
Length of output: 7594