navigation-timing icon indicating copy to clipboard operation
navigation-timing copied to clipboard

Extend 'NavigationType' to include User Agent Launch

Open bmathwig opened this issue 2 years ago • 13 comments

One of the challenges we've had at Microsoft is measuring the performance impact of a cold start launch for a particular site. This particularly apparent in PWA scenarios where the browser engine is launched and terminated frequently, such as in the case of Electron or WebView applications. Under this scenario, the browser is in a non-optimal state and measurements in the structure wouldn't necessarily reflect that of a normal navigation and could produce a false positive in telemetry aggregates.

We propose extending the NavigationType enumeration with a new item, useragent_launch, in order to signal to a developer that this particular event is taken from a launch scenario rather than a traditional navigation scenario.

Explainer: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/PerformanceNavigationTiming%20for%20User%20Agent%20Launch/explainer.md

Chromium Status: https://chromestatus.com/feature/5186950448283648

bmathwig avatar May 20 '22 16:05 bmathwig

I plan to discuss this at the next WebPerfWG call on June 9th.

amiyagupta avatar May 21 '22 15:05 amiyagupta

Discussion minutes

@yoavweiss you mentioned a follow-up to figure out how to map browser launch to HTML concepts, what would be the appropriate next step here?

amiyagupta avatar Jun 09 '22 23:06 amiyagupta

@domenic - do you know if there's an HTML concept that we can map to that can distinguish between a navigation that was initiated alongside a browser startup vs. navigations that weren't?

yoavweiss avatar Jun 10 '22 06:06 yoavweiss

There is no such concept.

domenic avatar Jun 10 '22 16:06 domenic

@domenic - Any advice on how such a concept may be added?

yoavweiss avatar Jun 13 '22 10:06 yoavweiss

I don't think I have any special guidance in this area, beyond the usual of trying to write specs in enough detail that they are interoperably implementable.

domenic avatar Jun 13 '22 14:06 domenic

What are the expected effects on PerformanceNavigationTiming metrics for this new useragent_launch NavigationType? Will the start up time incurred from cold starting the user agent be included as a new metric? Or does TimeOrigin already account for this? In other words, will developers be able to measure the app start up duration, i.e. the time before startTime, redirectStart, etc?

marcelduran avatar Aug 31 '22 18:08 marcelduran

@marcelduran this proposal does not intend to change the definitions of the timings, however we are working on a separate follow-up proposal that does.

amiyagupta avatar Aug 31 '22 22:08 amiyagupta

Based on the conversation in https://github.com/whatwg/html/issues/8150 about the change to "push" and "replace", it doesn't appear that we need to have a 1:1 mapping to an HTML historyHandling types for this change. We should be OK to add useragent_launch to the NavigationType enumeration.

bmathwig avatar Sep 14 '22 16:09 bmathwig

@bmathwig - what did you have in mind in terms of spec language?

yoavweiss avatar Sep 21 '22 05:09 yoavweiss

We have been hearing from partners that they really want a 'launch time' as well - so they can measure the full e2e time between the user launching a shortcut or a file (for file handling w/ installed app) to, say, getting that file in the launchQueue or the page loading.

I'm guessing we would need to add more information to the navigation to add this in there?

dmurph avatar Oct 26 '22 16:10 dmurph

@marcelduran this proposal does not intend to change the definitions of the timings, however we are working on a separate follow-up proposal that does.

Great @amiyagupta! Would you mind linking the proposal here once available?

marcelduran avatar Oct 27 '22 20:10 marcelduran

closing the loop a little bit - I made a request here to modify this proposal a tad: https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/614

dmurph avatar Dec 13 '22 20:12 dmurph