Skip to content
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

core(lantern): resolve some differences when using trace #16033

Merged
merged 11 commits into from
Jun 4, 2024

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Jun 4, 2024

  1. a handful of test failures were from node.record instead of node.request
  2. missed passing networkRecords to createTestTrace
  3. fixed difference re: requests from Fetch
  4. fixed difference re: data urls not having a resource size
  5. handle creating requests in a redirect chain better
  6. createTestTrace was putting initiator data on wrong event
  7. always produce network events in createTestTrace (since it impacts graph construction when doing cpu node linking)

ref #15841

@connorjclark connorjclark requested a review from a team as a code owner June 4, 2024 00:40
@connorjclark connorjclark requested review from adamraine and removed request for a team June 4, 2024 00:40
@@ -18,7 +18,6 @@ const NON_NETWORK_SCHEMES = [
];

/**
* Use `NetworkRequest.isNonNetworkRequest(req)` if working with a request.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive by, stale comment

@@ -131,7 +126,7 @@ describe('Byte efficiency base audit', () => {
}, simulator, metricComputationInput, {computedCache: new Map()});

assert.equal(result.metricSavings.FCP, 900);
assert.equal(result.metricSavings.LCP, 1350);
assert.equal(result.metricSavings.LCP, 900);
});
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the results changed here b/c createTestTrace is now always producing network events (not just when the env variable is true), so in the graph there is now a new dependency added from a network node to CPU node, cuz of the new ResourceSendRequest event (added in createTestTrace) linking the two (linkCPUNodes)

redirectedRequest.url = redirect.url;
redirectedRequest.parsedURL = this._createParsedUrl(redirect.url);
// TODO: TraceEngine is not retaining the actual status code.
redirectedRequest.statusCode = 302;
redirectedRequest.resourceType = undefined;
// TODO: TraceEngine is not retaining transfer size of redirected request.
redirectedRequest.transferSize = 400;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this always the transfer size of a redirect?

Copy link
Collaborator Author

@connorjclark connorjclark Jun 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that depends on the headers sent. 400 is just exactly the size of a trace I was debugging. But otherwise it would be the size of the final response and so this avoids an overestimate for the time being.

@connorjclark connorjclark changed the title core(lantern): resolve some differences when using trace for network core(lantern): resolve some differences when using trace Jun 4, 2024
@connorjclark connorjclark merged commit fdebcbe into main Jun 4, 2024
26 of 27 checks passed
@connorjclark connorjclark deleted the more-lantern-trace branch June 4, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants