Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 8dd6bff

Browse files
committed
Add telemetry for creating new windows. Fixes #2347
1 parent 93457a2 commit 8dd6bff

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

app/metrics.yaml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ distribution:
2525
2626
2727
expires: "2020-05-01"
28+
2829
url:
2930
domains:
3031
type: counter
@@ -70,6 +71,7 @@ url:
7071
7172
7273
expires: "2020-05-01"
74+
7375
searches:
7476
counts:
7577
type: labeled_counter
@@ -108,7 +110,6 @@ tabs:
108110
109111
110112
expires: "2020-05-01"
111-
112113
activated:
113114
type: counter
114115
description: >
@@ -137,7 +138,6 @@ firefox_account:
137138
138139
139140
expires: "2020-05-01"
140-
141141
sign_in_result:
142142
type: event
143143
description: >
@@ -153,7 +153,6 @@ firefox_account:
153153
154154
155155
expires: "2020-05-01"
156-
157156
sign_out:
158157
type: event
159158
description: >
@@ -166,7 +165,6 @@ firefox_account:
166165
167166
168167
expires: "2020-05-01"
169-
170168
bookmarks_sync_status:
171169
type: boolean
172170
lifetime: application
@@ -180,7 +178,6 @@ firefox_account:
180178
181179
182180
expires: "2020-05-01"
183-
184181
history_sync_status:
185182
type: boolean
186183
lifetime: application
@@ -194,7 +191,6 @@ firefox_account:
194191
195192
196193
expires: "2020-05-01"
197-
198194
tab_sent:
199195
type: counter
200196
description: >
@@ -207,7 +203,6 @@ firefox_account:
207203
208204
209205
expires: "2020-05-01"
210-
211206
received_tab:
212207
type: labeled_counter
213208
description: >
@@ -227,3 +222,19 @@ firefox_account:
227222
228223
229224
expires: "2020-05-01"
225+
226+
control:
227+
open_new_window:
228+
type: counter
229+
description: >
230+
Counting how many general windows are opened in a session.
231+
send_in_pings:
232+
- session_end
233+
bugs:
234+
- https://github.com/MozillaReality/FirefoxReality/issues/2347
235+
data_reviews:
236+
- https://github.com/MozillaReality/FirefoxReality/pull/2348#issuecomment-564736919
237+
notification_emails:
238+
239+
240+
expires: "2020-05-01"

app/src/common/shared/org/mozilla/vrbrowser/telemetry/GleanMetricsService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.mozilla.vrbrowser.GleanMetrics.Pings;
1313
import org.mozilla.vrbrowser.GleanMetrics.Searches;
1414
import org.mozilla.vrbrowser.GleanMetrics.Url;
15+
import org.mozilla.vrbrowser.GleanMetrics.Control;
1516
import org.mozilla.vrbrowser.browser.SettingsStore;
1617
import org.mozilla.vrbrowser.search.SearchEngineWrapper;
1718
import org.mozilla.vrbrowser.utils.DeviceType;
@@ -150,6 +151,10 @@ private static String getDefaultSearchEngineIdentifierForTelemetry() {
150151
return SearchEngineWrapper.get(context).getIdentifier();
151152
}
152153

154+
public static void newWindowOpenEvent() {
155+
Control.INSTANCE.getOpenNewWindow().add();
156+
}
157+
153158
private static void setStartupMetrics() {
154159
Distribution.INSTANCE.getChannelName().set(DeviceType.isOculusBuild() ? "oculusvr" : BuildConfig.FLAVOR_platform);
155160
}

app/src/common/shared/org/mozilla/vrbrowser/ui/widgets/Windows.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ public WindowWidget addWindow() {
249249
focusWindow(newWindow);
250250
updateCurvedMode(true);
251251
updateViews();
252+
253+
// We are only interested in general windows opened.
254+
if (!isInPrivateMode()) {
255+
GleanMetricsService.newWindowOpenEvent();
256+
}
252257
return newWindow;
253258
}
254259

docs/metrics.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ The following metrics are added to the ping:
5757

5858
| Name | Type | Description | Data reviews | Extras | Expiration |
5959
| --- | --- | --- | --- | --- | --- |
60+
| control.open_new_window |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Counting how many general windows are opened in a session. |[1](https://github.com/MozillaReality/FirefoxReality/pull/2348#issuecomment-564736919)||2020-05-01 |
6061
| distribution.channel_name |[string](https://mozilla.github.io/glean/book/user/metrics/string.html) |The distribution channel name of this application. We use this field to recognize Firefox Reality is distributed to which channels, such as wavevr, oculusvr, googlevr, etc. |[1](https://github.com/MozillaReality/FirefoxReality/pull/1854#issuecomment-546214568)||2020-05-01 |
6162
| tabs.activated |[counter](https://mozilla.github.io/glean/book/user/metrics/counter.html) |Number of tabs activated during a session |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)||2020-05-01 |
6263
| tabs.opened |[labeled_counter](https://mozilla.github.io/glean/book/user/metrics/labeled_counters.html) |Number of tabs opened during a session |[1](https://github.com/MozillaReality/FirefoxReality/pull/2327#issuecomment-559103837)|<ul><li>context_menu</li><li>tabs_dialog</li><li>bookmarks</li><li>history</li><li>fxa_login</li><li>received</li><li>pre_existing</li><li>browser</li></ul>|2020-05-01 |

0 commit comments

Comments
 (0)