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 374360 fe98d700bb64c12285d49e4a7cc77473fa72326e
parent 374359 223a0be483694b387c57f662a4639da28dab3a97
child 374361 bc61502be42e77e1dac46183c7a9075768f8292d
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdexter
bugs1313326
milestone54.0a1
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>