Bug 1252066 - Make UIMeasurements explicitly Android-only; r?gfritzsche draft
authorKate Uistiuzhanina <katejimme@gmail.com>
Wed, 08 Mar 2017 22:40:19 +0300
changeset 496057 fd49ca148c10c74632c59fda0f948eeb7ca01046
parent 493537 eb23648534779c110f3a1f2baae1849ae4a9c570
child 548536 77218b4e00c274ab9de58a12dce7eb429f01bffd
push id48515
push userbmo:katejimme@gmail.com
push dateThu, 09 Mar 2017 19:07:24 +0000
reviewersgfritzsche
bugs1252066
milestone54.0a1
Bug 1252066 - Make UIMeasurements explicitly Android-only; r?gfritzsche MozReview-Commit-ID: DIWOsNsaM4A
toolkit/components/telemetry/TelemetrySession.jsm
toolkit/components/telemetry/docs/data/main-ping.rst
toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
--- 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();