Editorial review: Document PerformanceNavigationTiming.confidence#43528
Editorial review: Document PerformanceNavigationTiming.confidence#43528chrisdavidmills wants to merge 3 commits intomdn:mainfrom
Conversation
|
@chrisdavidmills This says "technical review". Is it ready for me to look at? |
@hamishwillee. Not yet; I requested a tech review from the browser engineers yesterday. Once it is ready, I'll flip it to "Editorial review". |
mmocny
left a comment
There was a problem hiding this comment.
The docs look great, thanks for doing it!
I'm not the primary engineering contact for this, so hopefully Mike Jackson at Msft will have a change to take a look.
One detail that is missing from the docs: how should you use this value and interpret the data on the server? This feels like the most important part of the API, and also the harder to understand for developers.
Mike has done some presentations on this, and I see that he added a NOTE to the very bottom of this spection of the spec: https://www.w3.org/TR/navigation-timing-2/#sec-PerformanceNavigationTiming
This section is intended to help RUM providers and developers interpret confidence
...that section might be worth including in docs here?
Cheers.
|
|
||
| {{APIRef("Performance API")}}{{SeeCompatTable}} | ||
|
|
||
| The **`confidence`** read-only property of the {{domxref("PerformanceNavigationTiming")}} interface returns a {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be representative of the current user's device. |
There was a problem hiding this comment.
"representative of the current user's device"
I see that this wording comes from the navigation timing spec itself. Personally, I don't like that phrasing.
It's more like "known to have adverse conditions affecting performance" or something.
I think its fine to leave to match spec, but maybe Mike Jackson wants to take the chance to wordsmith?
There was a problem hiding this comment.
Maybe something like: returned navigation metrics free from external system load unrelated to the page.
There was a problem hiding this comment.
I like @mwjacksonmsft's wording; I'll update the wording to that in the places where it appears.
|
|
||
| The **`confidence`** read-only property of the {{domxref("PerformanceNavigationTiming")}} interface returns a {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be representative of the current user's device. | ||
|
|
||
| For example, if the browser has launched from a "cold start" before loading a website or has resource-intensive extensions running, or if other applications running on the user's device are taking up a lot of resource cycles, web pages may load more slowly as a result. In such cases, a `low` confidence {{domxref("PerformanceTimingConfidence.value", "value")}} would be returned. |
There was a problem hiding this comment.
Some of these are aspirational right now.
Should we make it clearer what is actually (I think cold startup?) vs might one day be affecting?
Mike is the expert.
There was a problem hiding this comment.
At the moment, this works for cold start, and session restore. I'd prefer that we only highlight those items (or call out that the others are potential future cases and not currently implemented).
There was a problem hiding this comment.
I've updated the wording on both pages it appears on to:
For example, if a website has loaded after a browser "cold start" or session restore, its pages may load more slowly as a result.
| - {{domxref('PerformanceNavigationTiming.activationStart')}} {{ReadOnlyInline}} {{experimental_inline}} | ||
| - : A {{domxref("DOMHighResTimeStamp")}} representing the time between when a document starts prerendering and when it is activated. | ||
| - {{domxref('PerformanceNavigationTiming.confidence')}} {{ReadOnlyInline}} {{experimental_inline}} | ||
| - : A {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be representative of the current user's device. |
There was a problem hiding this comment.
Should we adjust the language here as well to match confidence/index.md?
There was a problem hiding this comment.
Good call; done.
|
|
||
| {{APIRef("Performance API")}}{{SeeCompatTable}} | ||
|
|
||
| The **`value`** read-only property of the {{domxref("PerformanceTimingConfidence")}} interface is an enumerated value indicating a broad confidence measure of whether the user agent considers returned navigation metrics to be representative of the current user's device. |
There was a problem hiding this comment.
Same question here - should we update this to match the verbiage in confidence/index.md
This makes sense. For the moment, I've gone for including all the text in this section in the Anyway, I'll include that in my next commit. |
|
Cool, thanks, @mwjacksonmsft. I'll move this to the editorial review stage. @hamishwillee, ready for you to have a look, if you've still got time early next week. |
| For example, if a website has loaded after a browser "cold start" or session restore, its pages may load more slowly as a result. In such cases, a `low` confidence {{domxref("PerformanceTimingConfidence.value", "value")}} would be returned for an associated performance record. On the other hand, if the browser determines a returned performance record to be representative of typical application performance, a `high` confidence value is returned. | ||
|
|
||
| This confidence measure is useful for developers when trying to determine whether a performance issue is a legitimate concern, or an outlier being caused by external factors. |
There was a problem hiding this comment.
If you have a lot to say, interface pages tend to push the discussion down to a description.
I would push this and the "Interpreting confidence data".
|
|
||
| To compute debiased percentiles for both `high` and `low`: | ||
|
|
||
| 1. Follow the _computing debiased means_ steps to compute a per-record weight `w`. |
There was a problem hiding this comment.
This is unambiguous in the spec because " computing debiased means" would be a link.
|
|
||
| ## Interpreting confidence data | ||
|
|
||
| Since the {{domxref("PerformanceTimingConfidence.randomizedTriggerRate", "randomizedTriggerRate")}} can vary across records, per-record weighting is needed to recover unbiased aggregates. The procedure below illustrates how weighting based on {{domxref("PerformanceTimingConfidence.value", "value")}} can be applied before computing summary statistics. |
There was a problem hiding this comment.
There is always an argument around what you should expect a developer to reasonably interpret and how much hand holding you should do. To my mind though, basic questions like "why do I need to do this have not been answered".
Let's start backwards. Why are summary statistics needed and how do I use those?
What is an unbiased aggregate? Why do I care to recover one? Blah blah.
To put it another way, I can see myself following these instructions and generating the data, but then not knowing what to do with it.
|
|
||
| {{APIRef("Performance API")}}{{SeeCompatTable}} | ||
|
|
||
| The **`confidence`** read-only property of the {{domxref("PerformanceNavigationTiming")}} interface returns a {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be free from external system load unrelated to the page. |
There was a problem hiding this comment.
IMO it's not so much "free from" as "likely to be affected by". Something like
| The **`confidence`** read-only property of the {{domxref("PerformanceNavigationTiming")}} interface returns a {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be free from external system load unrelated to the page. | |
| The **`confidence`** read-only property of the {{domxref("PerformanceNavigationTiming")}} interface returns a {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be affected by external system load (unrelated to the page). |
YOu could also steal your own words from further down "considers a performance record to reflect typical application performance, or possibly be affected by external factors."
There was a problem hiding this comment.
It's a mouthful anyway, and it might be reasonable to assume that it is the user-agent's assumptions. If we can make that assumption maybe
| The **`confidence`** read-only property of the {{domxref("PerformanceNavigationTiming")}} interface returns a {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be free from external system load unrelated to the page. | |
| The **`confidence`** read-only property of the {{domxref("PerformanceNavigationTiming")}} interface returns a {{domxref("PerformanceTimingConfidence")}} object containing information that indicates the likelihood that navigation metrics have been been affected by factors unrelated to the page, such as external system load. |
| - {{domxref('PerformanceNavigationTiming.activationStart')}} {{ReadOnlyInline}} {{experimental_inline}} | ||
| - : A {{domxref("DOMHighResTimeStamp")}} representing the time between when a document starts prerendering and when it is activated. | ||
| - {{domxref('PerformanceNavigationTiming.confidence')}} {{ReadOnlyInline}} {{experimental_inline}} | ||
| - : A {{domxref("PerformanceTimingConfidence")}} object containing information that indicates whether the user agent considers returned navigation metrics to be free from external system load unrelated to the page. |
There was a problem hiding this comment.
As above, not so sure of "Free from".
|
|
||
| {{APIRef("Performance API")}}{{SeeCompatTable}} | ||
|
|
||
| The **`randomizedTriggerRate`** read-only property of the {{domxref("PerformanceTimingConfidence")}} interface is a number representing a percentage value that indicates how often noise is applied when exposing the {{domxref("PerformanceTimingConfidence.value")}}. |
There was a problem hiding this comment.
This is very complete and accurate, but it is hard to parse. Possibly it is not necessary to capture this all in one sentence here, since you should to that in the value.
| The **`randomizedTriggerRate`** read-only property of the {{domxref("PerformanceTimingConfidence")}} interface is a number representing a percentage value that indicates how often noise is applied when exposing the {{domxref("PerformanceTimingConfidence.value")}}. | |
| The **`randomizedTriggerRate`** read-only property of the {{domxref("PerformanceTimingConfidence")}} indicates how often noise is applied when exposing the {{domxref("PerformanceTimingConfidence.value")}}. |
There was a problem hiding this comment.
Either way
- why do we add noise? We should say, and also state what a high rate actually means vs a low rate.
- So 100% (1) would mean every
PerformanceTimingConfidencehas noise applied to the value. - If noise is applied does that flip the
value.
Just trying to get a feel for what a developer might do or not do with this knowledge.
|
|
||
| ## Value | ||
|
|
||
| A number inside the interval `0` to `1` inclusive. |
There was a problem hiding this comment.
How you do this depends on whether you do anything like the suggestion in https://github.com/mdn/content/pull/43528/changes#r3007055024
But, I would use wording like this if you don't change anything above.
| A number inside the interval `0` to `1` inclusive. | |
| A number between `0` and `1`, inclusive. |
|
|
||
| {{APIRef("Performance API")}}{{SeeCompatTable}} | ||
|
|
||
| The **`value`** read-only property of the {{domxref("PerformanceTimingConfidence")}} interface is an enumerated value indicating a broad confidence measure of whether the user agent considers returned navigation metrics to be free from external system load unrelated to the page. |
There was a problem hiding this comment.
A above...
| The **`value`** read-only property of the {{domxref("PerformanceTimingConfidence")}} interface is an enumerated value indicating a broad confidence measure of whether the user agent considers returned navigation metrics to be free from external system load unrelated to the page. | |
| The **`value`** read-only property of the {{domxref("PerformanceTimingConfidence")}} interface is an enumerated value indicating a broad confidence measure of whether the user agent considers returned navigation metrics to be affected by external system load unrelated to the page. |
| - {{domxref("PerformanceTimingConfidence.randomizedTriggerRate")}} {{ReadOnlyInline}} | ||
| - : A number representing a percentage value that indicates how often noise is applied when exposing the `value`. | ||
| - {{domxref("PerformanceTimingConfidence.value")}} {{ReadOnlyInline}} | ||
| - : An enumerated value indicating a broad confidence measure of whether the user agent considers returned navigation metrics to be representative of the current user's device. |
There was a problem hiding this comment.
This isn't right. The spec explicitly states that the confidence must not consider specifics fo the user device. YOu might mean "of the application".
Note, I do think you should clearly state that what contributes to the assessement, and make it clear that CPU etc do not count.
hamishwillee
left a comment
There was a problem hiding this comment.
Looks pretty good. I have questions.
It might be nice to mention this in https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Navigation_timing
Description
Chrome 145 adds support for the
PerformanceNavigationTiming.confidenceproperty, and the associatedPerformanceTimingConfidenceinterface. See https://chromestatus.com/feature/5186950448283648.This PR adds documentation for both features mentioned above.
Motivation
Additional details
Related issues and pull requests