Closed Bug 2071519 Opened 2 months ago Closed 1 month ago

Record a count of times when session restore resulted in zero tabs restored

Categories

(Firefox :: Session Restore, task, P3)

task

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: sfoster, Assigned: sfoster)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fidefe-session-restore])

Attachments

(1 external file)

session_restore.number_of_tabs_restored counts the number of tabs in the session that has just been restored. The minimum value is 1. The original motivation in bug 1198898 was to provide context for the startup time recorded - it helps us track one of the key inputs into startup performance. ISTM it may also be useful as a simple proxy for the work session restore is doing on behalf of the user, and as such a dip in the aggregate number is a warning sign. If we're concerned with what got restored as well as how long it took, this number is currently a little misleading. If 0 tabs restored would be an interesting number to know, we don't actually have any visibility in that currently.

As it stands, a restore that delivered nothing is indistinguishable from no restore having been attempted - both produce no sample. We have other metrics for restore outcome, so maybe this is ok? At minimum I think we should clarify what is (and isn't) being counted in the metric's description.

The early return here drops all five metrics in the group, not just number_of_tabs_restored. It is driven by eager-tab activity (_latestRestoredTimeStamp == _startTimeStamp), not on tab count, so a restore that opened three windows with 40 tab slots and then stalled throws away a count we already had.

We have other metrics for restore outcome, so maybe this is ok?

session_restore.number_of_tabs_restored only samples restores that were going well enough to load one tab and the other restore-outcome metrics sit behind this same return, so nothing covers this today. I'm updating the bug title as there are plausible paths to an outcome with 0 tabs restored. Bug 2080961 records whether a restore actually delivered, but leaves window and tab counts out of its own payload on the grounds that fixing them here is the right place rather than adding a separate count. Otherwise it can report that a restore didn't deliver but not how far it got.

Proposed fix: move the early return so it only guards the two duration metrics, and record the three counts on every restore attempt. A recorded sample will then mean "a restore was attempted" and no sample means "none was".

Note that number_of_tabs_restored has current range_min: 1, so we need to either confirm that a underflowing value will get recorded or amend that range (and the description for it and any queries that rely on it). For testing, StartupPerformance only runs during a real startup, so we'll need to cover this with a marionette test - test_session_decision.py is the closest template.

Summary: Consider recording a count of times when session restore resulted in zero tabs restored → Record a count of times when session restore resulted in zero tabs restored
See Also: → 2080961
Blocks: 2080961
  • restore complete in StartupPerformance only records durations when there's been (eager) tabs created
  • but always records window and tab/eager-tab counts so we catch the 0 values
  • a restore that opens 0 windows was previously not recorded because the deadline timer only starts per restored window, so sessionstore-windows-restored is now watched as well.
Assignee: nobody → sfoster
Status: NEW → ASSIGNED
Pushed by sfoster@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/2730193fa338 https://hg.mozilla.org/integration/autoland/rev/a22a87c9a208 Always record the session_restore.number_of* counts and 0 window session restores. r=sessionstore-reviewers,sclements
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 160 Branch
Regressions: 2083751
Pushed by asilaghi@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/cb3e4516427b https://hg.mozilla.org/integration/autoland/rev/0ac27b096ed4 Revert "Bug 2071519 - Always record the session_restore.number_of* counts and 0 window session restores. r=sessionstore-reviewers,sclements" for causing marionette failures and was requested by dev to back it out.

Backed out for causing marionette failures and it was requested by dev and approved by Aryx to be backed out.
https://hg.mozilla.org/integration/autoland/rev/0ac27b096ed44762d8af48a789022332bd50d129

Status: RESOLVED → REOPENED
Flags: needinfo?(sfoster)
Resolution: FIXED → ---
Target Milestone: 160 Branch → ---

Noted. I'll probably try to re-land this and Bug 2071519 as a stack once I get a green try push.

Flags: needinfo?(sfoster)
Pushed by sfoster@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/d3dc085403a1 https://hg.mozilla.org/integration/autoland/rev/216e32d9bf44 Always record the session_restore.number_of* counts and 0 window session restores. r=sessionstore-reviewers,sclements
Status: REOPENED → RESOLVED
Closed: 1 month ago → 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 161 Branch
QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: