TIME_TO_DOM_LOADING_MS telemetry probe is not reporting as many samples as expected

RESOLVED FIXED in Firefox 57

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: cpeterson, Assigned: wcpan)

Tracking

(Blocks: 1 bug)

unspecified
mozilla57
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 wontfix, firefox56 wontfix, firefox57 fixed)

Details

Attachments

(1 attachment)

(Reporter)

Description

a year ago
The telemetry sample counts for the various TIME_TO_DOM_*_MS telemetry probes are not exactly the same. IIUC, every (successful) page load passes through each of these loading states and thus we should expect exactly same number of DOM_LOADING samples as DOM_COMPLETE samples. But I see the following sample counts for Beta 55:

TIME_TO_DOM_LOADING_MS = 20.62M (This count is very small!!)
TIME_TO_DOM_INTERACTIVE_MS = 6.27B
TIME_TO_DOM_CONTENT_LOADED_START_MS = 7.08B
TIME_TO_DOM_CONTENT_LOADED_END_MS = 7.08B (LOADED_END count is same as LOADED_START, as I would expect)
TIME_TO_NON_BLANK_PAINT_MS = 4.02B
TIME_TO_DOM_COMPLETE_MS = 5.31B

https://telemetry.mozilla.org/new-pipeline/dist.html#max_channel_version=beta%252F55&measure=TIME_TO_DOM_LOADING_MS

In bug 1344893 comment 38, Wei-Cheng said:

> I think that's because mTiming does not always ready when the document is in loading state.
> We probably need to record those probes in nsDocument::SetReadyStateInternal directly.

If mTiming is not always ready when we report the telemetry, we may be missing some important telemetry data. TIME_TO_DOM_LOADING_MS, in particular, has two orders of magnitude fewer samples than the other TIME_TO_DOM_*_MS probes.
(Reporter)

Updated

a year ago
Blocks: 1344893
Do you think we still need to collect data from parent process? AFAIK those data in parent process only represents XUL/background page's loading time.
(Reporter)

Comment 2

a year ago
(In reply to Wei-Cheng Pan [:wcpan] [:wcp] [:legnaleurc] from comment #1)
> Do you think we still need to collect data from parent process? AFAIK those
> data in parent process only represents XUL/background page's loading time.

I don't think we need to collect any TIME_TO_DOM_* data from the parent process. As you pointed out, the parent process only records XUL/background page loads and we mostly care about the load times for real web pages.
Comment hidden (mozreview-request)
Assignee: nobody → wpan
Comment on attachment 8900130 [details]
Bug 1387625 - Fix TIME_TO_DOM_LOADING_MS record timing.

I need to change some parts.
Attachment #8900130 - Flags: review?(bugs)
Comment hidden (mozreview-request)
Remember that document.write usage after load event has fired may also disturb the metrics a bit.

Comment 7

a year ago
mozreview-review
Comment on attachment 8900130 [details]
Bug 1387625 - Fix TIME_TO_DOM_LOADING_MS record timing.

https://reviewboard.mozilla.org/r/171524/#review177308

But I guess this is at least better what we have now.
I still wonder what we should do with document.open()/write()/close() case.
Attachment #8900130 - Flags: review?(bugs) → review+
Comment hidden (mozreview-request)
Added flags to avoid interference from document.open()/write()/close().

Comment 10

a year ago
Pushed by wpan@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e40e343b7c37
Fix TIME_TO_DOM_LOADING_MS record timing. r=smaug

Comment 11

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/e40e343b7c37
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox57: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Too late for 56. Mass won't fix for 56.
status-firefox56: affected → wontfix
You need to log in before you can comment on or make changes to this bug.