Request priority in HAR file for Chromium based browsers#164
Request priority in HAR file for Chromium based browsers#164ozcoder wants to merge 12 commits intocloudflare:mainfrom
Conversation
Store the initial priority of each request. Store if the priority changes. Insert the initial priority value into the HAR file. Insert the final priority value into the HAR file.
Set types correctly on newPriorities and priorities. Check before using variables. Removed console debugging. Added fields to HarEntry.
|
The change itself looks reasonable, but I'm not able to verify it locally. How can I run telescope so that there are |
|
@sufian-cf if you run from the command line |
MildMax
left a comment
There was a problem hiding this comment.
verified working order of the initialPriority , priority, and resourceType in the chrome browser
sergeychernyshev
left a comment
There was a problem hiding this comment.
Looks like a good solution, we can make a couple improvements, see comments below.
Also, if you can make a fixture for testing the case with changing priority, it would be great. And maybe for testing duplicate requests.
Create mapping of hash of url and starting time to requestId. Gather resourceType is a better place. Fixup types.
| @@ -16,6 +17,34 @@ class ChromeRunner extends TestRunner { | |||
| async createPage(browser: BrowserContext): Promise<Page> { | |||
| const page = browser.pages()[0]; | |||
| const client: CDPSession = await page.context().newCDPSession(page); | |||
| await client.send('Network.enable'); | |||
There was a problem hiding this comment.
Is it possible Network.requestWillBeSent / other events below will fire before this client.send('Network.enable')?
There was a problem hiding this comment.
Shouldn't happen since even preparePage hasn't been called until the end of this method.
|
Hey @ozcoder, my apologies for the delay. I've taken a look at this approach and have manually verified that it sometimes works, but not for all requests. I've left a few comments, and overall am a bit concerned with the approach. That being said, I think this has surfaced a real bug in our existing code. If the page load triggers multiple requests with the same URL, we're going to only be updating performance information on the first one, since we look up the corresponding entry via I've just created #243 and will follow up with a fix that introduces a unique id per request we can use to match things. |
…t universes. Can just use this instead of occasion. Do not need responseReceived event handler.
Changed to use |
Added testing of priorities recorded in the HAR file. Removed uneeded rawTmings.
|
@sufian-cf @sergeychernyshev I have changed the code to use |
|
@ozcoder apologies, closed by accident |
Added compression option to createStaticServer. Show launchTest error if not successful. Fixed wrong alt information for small images. Tweeked test page design with some breakpoints.
|
@MildMax With the test server, I have added the ability to delay the responses to simulate processing time. I also added a compression option, which adds some jitter to the processing time and might be useful for other tests. To see why the GitHub CI might not be happy, I now show launchTest error if not successful. |
Adds
_priorityand_initialPriorityto the HAR file when testing with a Chromium based browser.Closes #16