Bug 1380626 - Fix about:telemetry child payload selection r=chutten
authorflyingrub <flyinggrub@gmail.com>
Thu, 13 Jul 2017 15:31:29 +0200
changeset 417980 1775a5bf18649a65016a929bb5270978bd14b493
parent 417979 25c4b42131276be014cc674720a58a0f061328ce
child 417981 4dc2076437aa25cacaf8427124042e3fa193b803
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1380626
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
@@ -723,18 +723,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");
 
@@ -1069,18 +1069,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;
@@ -2318,59 +2318,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);