RESOLVED FIXED Bug 205522
Resource Load Statistics: Add timing information to WebPageProxy::logFrameNavigation() to detect delayed client-side redirects
https://bugs.webkit.org/show_bug.cgi?id=205522
Summary Resource Load Statistics: Add timing information to WebPageProxy::logFrameNav...
John Wilander
Reported 2019-12-20 14:32:54 PST
We should detect delayed client-side redirects. This involves setting a timestamp in WebPageProxy::didFinishDocumentLoadForFrame() and using that timestamp to calculate the delay and pass it on in WebPageProxy::logFrameNavigation().
Attachments
Patch (31.25 KB, patch)
2019-12-20 16:51 PST, John Wilander
no flags
Patch (40.08 KB, patch)
2020-01-06 14:48 PST, John Wilander
no flags
Patch (46.36 KB, patch)
2020-01-08 11:40 PST, John Wilander
no flags
Radar WebKit Bug Importer
Comment 1 2019-12-20 14:33:17 PST
John Wilander
Comment 2 2019-12-20 16:51:50 PST
John Wilander
Comment 3 2020-01-06 14:48:50 PST
John Wilander
Comment 4 2020-01-06 16:44:00 PST
The Windows test failures look unrelated. http/wpt/css/css-highlight-api/ failures and one more CSS failure.
Chris Dumez
Comment 5 2020-01-07 11:59:51 PST
Comment on attachment 386892 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=386892&action=review > Source/WebKit/UIProcess/WebPageProxy.h:2656 > + MonotonicTime m_didFinishDocumentLoadForMainFrameTimestamp; I wish we did not have to add a WebPageProxy data member for this. Could this maybe be stored somewhere else, in ITP-specific code? > Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:238 > + terminationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:notificationName object:nil queue:nil usingBlock:^(NSNotification *note) { }]; What's the point of this termination observer that seems to do nothing? > LayoutTests/ChangeLog:9 > + Results updated with additional data now that delayed redirects are captured. Shouldn't we add a test specifically for what you're fixing though?
John Wilander
Comment 6 2020-01-07 12:38:08 PST
(In reply to Chris Dumez from comment #5) > Comment on attachment 386892 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=386892&action=review > > > Source/WebKit/UIProcess/WebPageProxy.h:2656 > > + MonotonicTime m_didFinishDocumentLoadForMainFrameTimestamp; > > I wish we did not have to add a WebPageProxy data member for this. Could > this maybe be stored somewhere else, in ITP-specific code? The timestamp is tied to the webpage and this is in the UI process where we don't really have any ITP code except for piping and API surface. Any idea of where it could go? > > Source/WebKit/UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:238 > > + terminationObserver = [[NSNotificationCenter defaultCenter] addObserverForName:notificationName object:nil queue:nil usingBlock:^(NSNotification *note) { }]; > > What's the point of this termination observer that seems to do nothing? Looks like it can be removed. Maybe it was only ever there for the purposes of ITP. > > LayoutTests/ChangeLog:9 > > + Results updated with additional data now that delayed redirects are captured. > > Shouldn't we add a test specifically for what you're fixing though? Sure, I can do that.
John Wilander
Comment 7 2020-01-08 11:40:56 PST
Chris Dumez
Comment 8 2020-01-09 12:26:14 PST
Comment on attachment 387118 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=387118&action=review > Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:225 > + Seconds minDelayAfterMainFrameDocumentLoadToNotBeARedirect { 5_s }; This seems really long to me.
John Wilander
Comment 9 2020-01-09 12:32:43 PST
(In reply to Chris Dumez from comment #8) > Comment on attachment 387118 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=387118&action=review > > > Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:225 > > + Seconds minDelayAfterMainFrameDocumentLoadToNotBeARedirect { 5_s }; > > This seems really long to me. I would agree if it wasn't for real measurement (on a fast machine). Here are three samples I still had in my logs: 1.920775 s 2.165201 s 2.231257 s Thanks for the review!
WebKit Commit Bot
Comment 10 2020-01-09 14:01:56 PST
Comment on attachment 387118 [details] Patch Clearing flags on attachment: 387118 Committed r254296: <https://trac.webkit.org/changeset/254296>
WebKit Commit Bot
Comment 11 2020-01-09 14:01:58 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.