Bug 1252066 - Make UIMeasurements explicitly Android-only; r?gfritzsche
MozReview-Commit-ID: DIWOsNsaM4A
--- a/toolkit/components/telemetry/TelemetrySession.jsm
+++ b/toolkit/components/telemetry/TelemetrySession.jsm
@@ -1338,17 +1338,20 @@ var Impl = {
let addonHistograms = protect(() => this.getAddonHistograms());
if (addonHistograms && Object.keys(addonHistograms).length > 0) {
payloadObj.addonHistograms = addonHistograms;
}
payloadObj.addonDetails = protect(() => AddonManagerPrivate.getTelemetryDetails());
let clearUIsession = !(reason == REASON_GATHER_PAYLOAD || reason == REASON_GATHER_SUBSESSION_PAYLOAD);
- payloadObj.UIMeasurements = protect(() => UITelemetry.getUIMeasurements(clearUIsession));
+
+ if (AppConstants.platform == "android") {
+ payloadObj.UIMeasurements = protect(() => UITelemetry.getUIMeasurements(clearUIsession));
+ }
if (this._slowSQLStartup &&
Object.keys(this._slowSQLStartup).length != 0 &&
(Object.keys(this._slowSQLStartup.mainThread).length ||
Object.keys(this._slowSQLStartup.otherThreads).length)) {
payloadObj.slowSQLStartup = this._slowSQLStartup;
}
--- a/toolkit/components/telemetry/docs/data/main-ping.rst
+++ b/toolkit/components/telemetry/docs/data/main-ping.rst
@@ -65,17 +65,17 @@ Structure:
capturedStacks: {...},
log: [...],
webrtc: {...},
gc: {...},
fileIOReports: {...},
lateWrites: {...},
addonDetails: {...},
addonHistograms: {...},
- UIMeasurements: [...],
+ UIMeasurements: [...], // Android only
slowSQL: {...},
slowSQLstartup: {...},
}
info
----
sessionLength
@@ -666,17 +666,17 @@ Structure:
},
slowSQLStartup
--------------
This section contains the slow SQL statements gathered at startup (until the "sessionstore-windows-restored" event is fired). The structure of this section resembles the one for `slowSQL`_.
UIMeasurements
--------------
-This section contains UI specific telemetry measurements and events. This section is mainly populated with Android-specific data and events (`see here <https://dxr.mozilla.org/mozilla-central/search?q=regexp%3AUITelemetry.%28addEvent|startSession|stopSession%29&redirect=false&case=false>`_).
+This section is Android-only and contains UI specific Telemetry measurements and events (`see here <https://dxr.mozilla.org/mozilla-central/search?q=regexp%3AUITelemetry.%28addEvent|startSession|stopSession%29&redirect=false&case=false>`_).
Structure:
.. code-block:: js
"UIMeasurements": [
{
"type": "event", // either "session" or "event"
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
@@ -1772,19 +1772,23 @@ add_task(function* test_schedulerNothing
yield TelemetryController.testShutdown();
PingServer.resetPingHandler();
});
add_task(function* test_pingExtendedStats() {
const EXTENDED_PAYLOAD_FIELDS = [
"chromeHangs", "threadHangStats", "log", "slowSQL", "fileIOReports", "lateWrites",
- "addonHistograms", "addonDetails", "UIMeasurements", "webrtc"
+ "addonHistograms", "addonDetails", "webrtc"
];
+ if (AppConstants.platform == "android") {
+ EXTENDED_PAYLOAD_FIELDS.push("UIMeasurements");
+ }
+
// Reset telemetry and disable sending extended statistics.
yield TelemetryStorage.testClearPendingPings();
PingServer.clearRequests();
yield TelemetryController.testReset();
Telemetry.canRecordExtended = false;
yield sendPing();