Bug 1380626 - Fix about:telemetry child payload selection r?chutten draft
authorflyingrub <flyinggrub@gmail.com>
Thu, 13 Jul 2017 15:31:29 +0200
changeset 608302 dc4cdb73b99b2df21466f074eaa7928c25ba93fe
parent 606207 d6f2a893cd7a77cacbb1b139fff78d09c2f001e0
child 637270 2673f66a00717f35bb6801748c5b28fa3bc5eebf
push id68238
push userbmo:flyinggrub@gmail.com
push dateThu, 13 Jul 2017 13:32:22 +0000
reviewerschutten
bugs1380626
milestone56.0a1
Bug 1380626 - Fix about:telemetry child payload selection r?chutten Prevent a bug on child payload selection. MozReview-Commit-ID: L0JEOUGEONI
toolkit/content/aboutTelemetry.js
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -730,18 +730,18 @@ var EnvironmentData = {
     aRowElement.appendChild(colElement);
   },
 };
 
 var TelLog = {
   /**
    * Renders the telemetry log
    */
-  render(aPing) {
-    let entries = aPing.payload.log;
+  render(payload) {
+    let entries = payload.log;
     const hasData = entries && entries.length > 0;
     setHasData("telemetry-log-section", hasData);
     if (!hasData) {
       return;
     }
 
     let table = document.createElement("table");
 
@@ -1076,18 +1076,18 @@ function SymbolicationRequest_fetchSymbo
 
 var ChromeHangs = {
 
   symbolRequest: null,
 
   /**
    * Renders raw chrome hang data
    */
-  render: function ChromeHangs_render(aPing) {
-    let hangs = aPing.payload.chromeHangs;
+  render: function ChromeHangs_render(payload) {
+    let hangs = payload.chromeHangs;
     setHasData("chrome-hangs-section", !!hangs);
     if (!hangs) {
       return;
     }
 
     let stacks = hangs.stacks;
     let memoryMap = hangs.memoryMap;
     let durations = hangs.durations;
@@ -2251,59 +2251,62 @@ function displayRichPingData(ping, updat
   // For any other pings we just render the raw JSON payload.
   let isMainPing = (ping.type == "main" || ping.type == "saved-session");
   togglePingSections(isMainPing);
 
   if (!isMainPing) {
     return;
   }
 
-  // Show telemetry log.
-  TelLog.render(ping);
-
   // Show slow SQL stats
   SlowSQL.render(ping);
 
-  // Show chrome hang stacks
-  ChromeHangs.render(ping);
-
   // Render Addon details.
   AddonDetails.render(ping);
 
-  // Select payload to render
-  let payloadSelect = document.getElementById("choose-payload");
-  let payloadOption = payloadSelect.selectedOptions.item(0);
-  let payloadIndex = payloadOption.getAttribute("value");
-
   let payload = ping.payload;
-  if (payloadIndex > 0) {
-    payload = ping.payload.childPayloads[payloadIndex - 1];
-  }
-
-  // Show thread hang stats
-  ThreadHangStats.render(payload);
-
-  // Show captured stacks.
-  CapturedStacks.render(payload);
-
-  // Show simple measurements
-  SimpleMeasurements.render(payload);
-
-  LateWritesSingleton.renderLateWrites(payload.lateWrites);
-
   // Show basic session info gathered
   SessionInformation.render(payload);
 
   // Show scalar data.
   Scalars.render(payload);
   KeyedScalars.render(payload);
 
   // Show histogram data
   HistogramSection.render(payload);
 
   // Show keyed histogram data
   KeyedHistogramSection.render(payload);
 
   // Show event data.
   Events.render(payload);
+
+  // Show captured stacks.
+  CapturedStacks.render(payload);
+
+  LateWritesSingleton.renderLateWrites(payload.lateWrites);
+
+  // Select payload to render
+  let payloadSelect = document.getElementById("choose-payload");
+  let payloadOption = payloadSelect.selectedOptions.item(0);
+  let payloadIndex = payloadOption.getAttribute("value");
+
+  if (payloadIndex > 0) {
+    payload = ping.payload.childPayloads[payloadIndex - 1];
+  }
+
+  console.log(payload);
+
+  // Show chrome hang stacks
+  ChromeHangs.render(payload);
+
+  // Show telemetry log.
+  TelLog.render(payload);
+
+  // Show thread hang stats
+  ThreadHangStats.render(payload);
+
+  // Show simple measurements
+  SimpleMeasurements.render(payload);
+
 }
 
 window.addEventListener("load", onLoad);