Closed Bug 952180 Opened 11 years ago Closed 11 years ago

BrowserUITelemetry is mostly returning empty toolbar data.

Categories

(Firefox :: Toolbars and Customization, defect)

x86
All
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 29
Tracking Status
firefox27 --- fixed
firefox28 --- fixed
firefox29 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

Details

(Whiteboard: [Australis:P-][fixed-in-holly][qa-])

Attachments

(2 files, 2 obsolete files)

Out of curiosity, I took a look at some of my profile's saved pings to see how the UITelemetry stuff is being recorded.

For almost all of the saved session pings, I'm seeing empty objects attached to UITelemetry, which is not good.

I did a job on an EC2 instance to get pings form yesterday's Aurora's to see if this is typical. It appears to be.

So:

The bad: we've gathered probably no useful UITelemetry data at this point.
The good: we caught this early, and we can fix it.

I think this has to do with the fact that most saved session pings attempt to gather their data during the shutdown phase after the windows have been closed. The BrowserUITelemetry getSimpleMeasures code bails out if it can't find a browser window to read toolbar data from. The solution to this is to try to read this sometime after browser-delayed-startup-finished and cache it.

I'll be working on that this afternoon.
Attached patch Patch v1 - for non-Australis (obsolete) — Splinter Review
My approach here is to gather the measurements on the first window that opens, after it's fired its browser-delayed-startup-finished event, and cache those measurements until the point where a TelemetryPing is gathered.

This means that things like changes to the toolbar contents and collapsed states will not be captured until the next browser session. Customize mode duration and click events on toolbar items will, however, be up to date.
Comment on attachment 8350254 [details] [diff] [review]
Patch v1 - for non-Australis

Thoughts on this, jaws? I've tested locally that this actually capturing stuff on profile shut down, and it is indeed doing that.
Attachment #8350254 - Flags: review?(jaws)
Attached patch Patch v1 - for Australis (obsolete) — Splinter Review
Comment on attachment 8350276 [details] [diff] [review]
Patch v1 - for Australis

And the Australis port.
Attachment #8350276 - Flags: review?(jaws)
Comment on attachment 8350254 [details] [diff] [review]
Patch v1 - for non-Australis

Review of attachment 8350254 [details] [diff] [review]:
-----------------------------------------------------------------

Looks mostly good, but still need to address the popup issue mentioned below.

::: browser/modules/BrowserUITelemetry.jsm
@@ +318,5 @@
> +    // UITelemetry to ask for our measurements because at that point
> +    // all browser windows have probably been closed, since the vast
> +    // majority of saved-session pings are gathered during shutdown.
> +    if (!this._firstWindowMeasurements) {
> +      this._firstWindowMeasurements = this._getWindowMeasurements(aWindow);

The previous code made sure that the window being used was non-private and non-popup. This now does neither of those two. Over IRC it was said that we are OK with gathering this kind of telemetry from private windows, but I'm pretty sure we still need to make sure that the window is not a popup window.
Attachment #8350254 - Flags: review?(jaws) → review-
Comment on attachment 8350276 [details] [diff] [review]
Patch v1 - for Australis

Review of attachment 8350276 [details] [diff] [review]:
-----------------------------------------------------------------

Same feedback as other patch.
Attachment #8350276 - Flags: review?(jaws) → review-
Thanks for the review! Updated so that we check for aWindow.toolbar.visible before sampling the window. We'll skip windows until we hit one that has aWindow.toolbar.visible true.

If we somehow never get to a non-popup window, getToolbarMeasurements is ready to handle this._firstWindowMeasurements being null, and just packs the rest of the measurements into an empty object.
Attachment #8350254 - Attachment is obsolete: true
Attachment #8350299 - Flags: review?(jaws)
And the Australis patch.
Attachment #8350276 - Attachment is obsolete: true
Attachment #8350300 - Flags: review?(jaws)
Attachment #8350300 - Flags: review?(jaws) → review+
Attachment #8350299 - Flags: review?(jaws) → review+
Comment on attachment 8350299 [details] [diff] [review]
Patch v1.1 - for non-Australis

[Approval Request Comment]
Bug caused by (feature/regressing bug #): 

BrowserUITelemetry wasn't reporting things because we failed to account for the fact that most TelemetryPings are gathered when the browser is shutting down and windows are closed. BrowserUITelemetry was returning nothing because it couldn't find a window to sample.


User impact if declined: 

None, but no UITelemetry data for us. :(


Testing completed (on m-c, etc.): 

Tested that shutdown pings contain the UITelemetry data that we require.


Risk to taking this patch (and alternatives if risky): 

Very low.


String or IDL/UUID changes made by this patch:

None.
Attachment #8350299 - Flags: approval-mozilla-beta?
Attachment #8350299 - Flags: approval-mozilla-aurora?
Whiteboard: [Australis:P-] → [Australis:P-][fixed-in-holly]
https://hg.mozilla.org/mozilla-central/rev/c3239da6de33
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 29
Attachment #8350299 - Flags: approval-mozilla-beta?
Attachment #8350299 - Flags: approval-mozilla-beta+
Attachment #8350299 - Flags: approval-mozilla-aurora?
Attachment #8350299 - Flags: approval-mozilla-aurora+
Whiteboard: [Australis:P-][fixed-in-holly] → [Australis:P-][fixed-in-holly][qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: