Bug 1313326 - Part 3: Update about:telemetry to show child process events. r=dexter
☠☠ backed out by a756569e4a3c ☠ ☠
authorGeorg Fritzsche <georg.fritzsche@googlemail.com>
Wed, 15 Feb 2017 17:00:11 +0100
changeset 394310 fe98d700bb64c12285d49e4a7cc77473fa72326e
parent 394309 223a0be483694b387c57f662a4639da28dab3a97
child 394311 bc61502be42e77e1dac46183c7a9075768f8292d
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdexter
bugs1313326
milestone54.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 1313326 - Part 3: Update about:telemetry to show child process events. r=dexter
toolkit/content/aboutTelemetry.js
toolkit/content/aboutTelemetry.xhtml
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -309,16 +309,18 @@ var PingPicker = {
     document.getElementById("scalars-processes")
             .addEventListener("change", () => displayPingData(gPingData));
     document.getElementById("keyed-scalars-processes")
             .addEventListener("change", () => displayPingData(gPingData));
     document.getElementById("histograms-processes")
             .addEventListener("change", () => displayPingData(gPingData));
     document.getElementById("keyed-histograms-processes")
             .addEventListener("change", () => displayPingData(gPingData));
+    document.getElementById("events-processes")
+            .addEventListener("change", () => displayPingData(gPingData));
   },
 
   onPingSourceChanged() {
     this.update();
   },
 
   onPingDisplayChanged() {
     this.update();
@@ -1729,17 +1731,26 @@ var Events = {
   render(aPayload) {
     let eventsSection = document.getElementById("events");
     removeAllChildNodes(eventsSection);
 
     if (!aPayload.processes || !aPayload.processes.parent) {
       return;
     }
 
-    const events = aPayload.processes.parent.events;
+    let processesSelect = document.getElementById("events-processes");
+    let selectedProcess = processesSelect.selectedOptions.item(0).getAttribute("value");
+
+    if (!aPayload.processes ||
+        !selectedProcess ||
+        !(selectedProcess in aPayload.processes)) {
+      return;
+    }
+
+    let events = aPayload.processes[selectedProcess].events;
     const hasData = events && Object.keys(events).length > 0;
     setHasData("events-section", hasData);
     if (!hasData) {
       return;
     }
 
     const headings = [
       "timestampHeader",
@@ -2077,16 +2088,17 @@ function displayPingData(ping, updatePay
 
   // Update the payload list and process lists
   if (updatePayloadList) {
     renderPayloadList(ping);
     renderProcessList(ping, document.getElementById("scalars-processes"));
     renderProcessList(ping, document.getElementById("keyed-scalars-processes"));
     renderProcessList(ping, document.getElementById("histograms-processes"));
     renderProcessList(ping, document.getElementById("keyed-histograms-processes"));
+    renderProcessList(ping, document.getElementById("events-processes"));
   }
 
   // Show general data.
   GeneralData.render(ping);
 
   // Show environment data.
   EnvironmentData.render(ping);
 
--- a/toolkit/content/aboutTelemetry.xhtml
+++ b/toolkit/content/aboutTelemetry.xhtml
@@ -186,16 +186,19 @@
         </div>
       </section>
 
       <section id="events-section" class="data-section">
         <input type="checkbox" class="statebox"/>
         <h1 class="section-name">&aboutTelemetry.eventsSection;</h1>
         <span class="toggle-caption">&aboutTelemetry.toggle;</span>
         <span class="empty-caption">&aboutTelemetry.emptySection;</span>
+        <div class="processes-ui">
+          <select id="events-processes" class="process-picker"></select>
+        </div>
         <div id="events" class="data">
         </div>
       </section>
 
       <section id="simple-measurements-section" class="data-section">
         <input type="checkbox" class="statebox"/>
         <h1 class="section-name">&aboutTelemetry.simpleMeasurementsSection;</h1>
         <span class="toggle-caption">&aboutTelemetry.toggle;</span>