Skip to content

Editorial review: Document PerformanceNavigationTiming.confidence#43528

Open
chrisdavidmills wants to merge 3 commits intomdn:mainfrom
chrisdavidmills:performancenavigationtiming-confidence
Open

Editorial review: Document PerformanceNavigationTiming.confidence#43528
chrisdavidmills wants to merge 3 commits intomdn:mainfrom
chrisdavidmills:performancenavigationtiming-confidence

Conversation

@chrisdavidmills
Copy link
Copy Markdown
Contributor

@chrisdavidmills chrisdavidmills commented Mar 23, 2026

Description

Chrome 145 adds support for the PerformanceNavigationTiming.confidence property, and the associated PerformanceTimingConfidence interface. See https://chromestatus.com/feature/5186950448283648.

This PR adds documentation for both features mentioned above.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner March 23, 2026 09:56
@chrisdavidmills chrisdavidmills requested review from hamishwillee and removed request for a team March 23, 2026 09:56
@github-actions github-actions bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Mar 23, 2026
@chrisdavidmills chrisdavidmills changed the title Document PerformanceNavigationTiming.confidence Technical review: Document PerformanceNavigationTiming.confidence Mar 23, 2026
@hamishwillee
Copy link
Copy Markdown
Collaborator

@chrisdavidmills This says "technical review". Is it ready for me to look at?

@chrisdavidmills
Copy link
Copy Markdown
Contributor Author

@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".

Copy link
Copy Markdown

@mmocny mmocny left a comment

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

"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?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Maybe something like: returned navigation metrics free from external system load unrelated to the page.

Copy link
Copy Markdown
Contributor Author

@chrisdavidmills chrisdavidmills Mar 27, 2026

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should we adjust the language here as well to match confidence/index.md?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same question here - should we update this to match the verbiage in confidence/index.md

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@chrisdavidmills
Copy link
Copy Markdown
Contributor Author

Mike has done some presentations on this, and I see that he added a NOTE to the very bottom of this section 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?

This makes sense. For the moment, I've gone for including all the text in this section in the PerformanceTimingConfidence page, under a heading of "Interpreting confidence data". I've not made many changes, except for a few tweaks, and adding links to the different values.

Anyway, I'll include that in my next commit.

Copy link
Copy Markdown

@mwjacksonmsft mwjacksonmsft left a comment

Choose a reason for hiding this comment

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

These changes LGTM. Thanks!

@chrisdavidmills chrisdavidmills changed the title Technical review: Document PerformanceNavigationTiming.confidence Editorial review: Document PerformanceNavigationTiming.confidence Mar 27, 2026
@chrisdavidmills
Copy link
Copy Markdown
Contributor Author

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.

Comment on lines +12 to +14
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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`.
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee Mar 30, 2026

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee Mar 30, 2026

Choose a reason for hiding this comment

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

IMO it's not so much "free from" as "likely to be affected by". Something like

Suggested change
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."

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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

Suggested change
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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")}}.
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee Mar 30, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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")}}.

Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee Mar 30, 2026

Choose a reason for hiding this comment

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

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 PerformanceTimingConfidence has 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.
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee Mar 30, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A above...

Suggested change
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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee left a comment

Choose a reason for hiding this comment

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants