[Fx View] Update telemetry for dismissal of recently closed tabs
Categories
(Firefox :: Firefox View, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox109 | --- | verified |
People
(Reporter: kcochrane, Assigned: kcochrane)
References
Details
(Whiteboard: [fidefe-2022-mr1-firefox-view] )
Attachments
(2 files, 1 obsolete file)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
2.89 KB,
text/plain
|
chutten
:
data-review+
|
Details |
In updates from bug 1787945, we’re currently using the same recently_closed event that we use to record when the tab was clicked/reopened from Fx View. We should create a new one named dismiss_closed_tab or something similar, so we can record those events separately.
We'll also want to capture the frequency of tab dismissal here.
Updated•3 years ago
|
Updated•3 years ago
|
| Assignee | ||
Comment 1•3 years ago
|
||
For this new event, we'll record the time between the tab was closed and when the user dismissed the tab from Recently Closed tabs in Fx View. These events can be counted up server-side to track frequency of use. In the future, if we want a more eloquent way of tracking frequency of use, we may want to consider using Glean in Firefox View rather than the legacy Telemetry system. I wanted to implement this solution for the time being though, since we are targeting v109.
:chutten could you provide some more info on the benefits of switching to Glean so product can weigh in? If we want to eventually make the switch, I can go ahead and write something up separately for that.
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 2•3 years ago
|
||
| Assignee | ||
Comment 3•3 years ago
|
||
:rframbro just adding a needinfo here to make sure you're on board with what I've mentioned in comment 1.
Comment 5•3 years ago
|
||
Hello Kelly! Can you please provide us with some steps on how to verify the telemetry for dismissed tabs after this lands? We need this for testing QA-1692 as well. Thank you in advance!
| Assignee | ||
Comment 6•3 years ago
•
|
||
:atrif, I've added a new telemetry event named dismiss_closed_tab for this that should fire every time you dismiss a tab in Recently Closed tabs in Fx View. It will be recorded as the time (in seconds) since the tab was originally closed to when it was dismissed.
If you navigate to about:telemetry and click the Events link in the left menu of this page, you should see this new event shown every time you dismiss a Recently Closed tab. NOTE: You'll need to refresh this page to see latest events appear.
| Assignee | ||
Comment 7•3 years ago
|
||
| Assignee | ||
Updated•3 years ago
|
| Assignee | ||
Comment 8•3 years ago
|
||
Comment 9•3 years ago
|
||
(In reply to Kelly Cochrane [:kcochrane] from comment #1)
:chutten could you provide some more info on the benefits of switching to Glean so product can weigh in? If we want to eventually make the switch, I can go ahead and write something up separately for that.
The benefits for using Glean are many and varied, so I'm not sure which would be specifically relevant here... but I'll try my best. Let's see, let's see... oh, you're talking events? Events are so much easier to define, use, and test in Glean than in Legacy Telemetry:
- Define: No need to figure out the
category+method+objecttriple, we've pared it down tocategory.nameonly. Like the rest of the metrics. Plus, event extras can be defined to bestringorquantityorboolean, meaning you can speak more deeply about your extra keys with your definition than you could with Telemetry. - Use: No
value, no strings, and rich types forextrakeys:
Fine:
Services.telemetry.recordEvent(
"close_tab_warning",
"shown",
"application",
null,
{
source: this._quitSource,
button: buttonPressed == 0 ? "close" : "cancel",
warn_checkbox: warnCheckbox,
closing_wins: "" + windowcount,
closing_tabs: "" + (pagecount + pinnedcount),
will_restore: sessionWillBeRestored ? "yes" : "no",
}
)
Better:
Glean.closeTabWarning.applicationShown.record({
source: this._quitSource,
button: buttonPressed == 0 ? "close" : "cancel",
warn_checkbox: warnCheckbox,
closing_wins: windowcount,
closing_tabs: (pagecount + pinnedcount),
will_restore: sessionWillBeRestored,
});
- Test: No more snapshotting every event and filtering to the one you want (ideally with
TelemetryTestUtils.assertEvents()), instead testing is as easy as recording the data:Assert.equal(1, Glean.closeTabWarning.applicationShown.testGetValue().length);
Also, if you ever need your events to be sent on your own schedule in your own custom ping: that's only supported in Glean.
But your analyses may still be in Legacy, so wouldn't it be a nice present if you could use the Glean APIs while also getting your data into Legacy Telemetry? Well, I say "a nice present" but what I mean is a GIFFT: if you define a Glean event and a Telemetry Event and add a telemetry_mirror: property to the Glean one... then your event will be sent in both systems. Let Firefox on Glean (FOG) take care of translating from Glean's pleasant API to Telemetry's... slightly-older version.
You'll notice that this means you don't have to do a big Switch To Glean: you can instead, one at a time, just pull across the ones you happen to be working on or adding. There are a few wrinkles and corner cases for adapting existing stuff (notably if you're using value), so if you're going that route do feel free to ask anyone on my team for assistance. We'll help you out.
Is that the sort of thing you were looking for?
Comment 10•3 years ago
|
||
Comment on attachment 9306949 [details]
Firefox View Data Collection Request.txt
DATA COLLECTION REVIEW RESPONSE:
Is there or will there be documentation that describes the schema for the ultimate data set available publicly, complete and accurate?
Yes.
Is there a control mechanism that allows the user to turn the data collection on and off?
Yes. This collection is Telemetry so can be controlled through Firefox's Preferences.
If the request is for permanent data collection, is there someone who will monitor the data over time?
Yes, :kcochrane is responsible.
Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?
Category 2, Interaction.
Is the data collection request for default-on or default-off?
Default on for all channels.
Does the instrumentation include the addition of any new identifiers?
No.
Is the data collection covered by the existing Firefox privacy notice?
Yes.
Does the data collection use a third-party collection tool?
No.
Result: datareview+
Comment 11•3 years ago
|
||
(Oh, and another benefit of using Glean: ./mach data-review <bug number> will generate a data review request template for you, to save you time)
Comment 12•3 years ago
|
||
Comment 13•3 years ago
|
||
| bugherder | ||
Comment 14•3 years ago
|
||
(In reply to Kelly Cochrane [:kcochrane] from comment #6)
:atrif, I've added a new telemetry event named
dismiss_closed_tabfor this that should fire every time you dismiss a tab in Recently Closed tabs in Fx View. It will be recorded as the time (in seconds) since the tab was originally closed to when it was dismissed.
If you navigate toabout:telemetryand click theEventslink in the left menu of this page, you should see this new event shown every time you dismiss a Recently Closed tab. NOTE: You'll need to refresh this page to see latest events appear.
Thank you! We verified this today with Firefox 109.0a1 (2022-12-08) on Windows 10x64, macOS 11, and Ubuntu 22.04. A new dismiss_closed_tab event is fired every time a tab is dismissed from Firefox View > Recently closed tabs. Each dismiss_closed_tab event has a time that is calculated from when the tab was originally closed to when it was dismissed in seconds.
I am leaving this open until we will test QA-1692 again in beta 109 as well.
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Verified fixed with Firefox 109.0b5 on Windows 10x64, macOS 10.15, and Ubuntu 20.04. A new new dismiss_closed_tab event is fired every time a tab is dismissed from Firefox View > Recently closed. Each dismiss_closed_tab event has a time that is calculated from when the tab was originally closed to when it was dismissed in seconds.
Description
•