Bug 1389165 - Fix the search for thread hangs in about:telemetry r=chutten
authorflyingrub <flyinggrub@gmail.com>
Thu, 10 Aug 2017 22:10:11 +0200
changeset 647023 3b5f1b11db0ebd0b914c42eff7dbf44ab47cf638
parent 647022 07b2b1b55448631484cbb388bc8e48b538bbe23f
child 647024 850ff7976b8df05512722aa8942ff050cc054671
push id74288
push userhikezoe@mozilla.com
push dateWed, 16 Aug 2017 00:19:57 +0000
reviewerschutten
bugs1389165
milestone57.0a1
Bug 1389165 - Fix the search for thread hangs in about:telemetry r=chutten MozReview-Commit-ID: 8nYRcwEEBvD
toolkit/content/aboutTelemetry.js
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -1162,16 +1162,17 @@ var ThreadHangStats = {
    * Creates and fills data corresponding to a thread
    */
   renderThread(aThread) {
     let div = document.createElement("div");
 
     let title = document.createElement("h2");
     title.textContent = aThread.name;
     div.appendChild(title);
+    div.id = title;
 
     // Don't localize the histogram name, because the
     // name is also used as the div element's ID
     Histogram.render(div, aThread.name + "-Activity",
                      aThread.activity, {exponential: true}, true);
     aThread.hangs.forEach((hang, index) => {
       let hangName = aThread.name + "-Hang-" + (index + 1);
       let hangDiv = Histogram.render(
@@ -1474,16 +1475,24 @@ var Search = {
     } else if (selectedSection.id === "keyed-scalars-section") {
       let keyedElements = [];
       let keyedScalars = selectedSection.getElementsByClassName("keyed-scalar");
       for (let key of keyedScalars) {
         let datas = key.querySelector("table").rows;
         keyedElements.push({key, datas});
       }
       this.filterKeyedElements(keyedElements, text);
+    } else if (selectedSection.id === "thread-hang-stats-section") {
+      let keyedElements = [];
+      let threads = selectedSection.children[0].children;
+      for (let key of threads) {
+        let datas = key.getElementsByClassName("histogram");
+        keyedElements.push({key, datas});
+      }
+      this.filterKeyedElements(keyedElements, text);
     } else {
       let tables = selectedSection.querySelectorAll("table");
       for (let table of tables) {
         this.filterElements(table.rows, text);
       }
     }
   },
 }