Bug 1561201 - Expose the list of build resource data from `mach resource-usage` page. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Tue, 25 Jun 2019 16:48:19 +0000
changeset 542920 578f090c90856faf65e33296a1bcd60ba7e69eff
parent 542919 dcf33acba09527474a11e107f71583916fc86cbe
child 542921 14659558eaad0da11cfe567cf9304ef67d666ddf
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1561201
milestone69.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 1561201 - Expose the list of build resource data from `mach resource-usage` page. r=nalexander The `mach resource-usage` page supports a list of build resource data, but only ever displays the first one. Nothing actually creates a list with multiple items automatically, but one might want to do that manually to explore data from multiple builds more conveniently. So if such a list exists, we expose a dropdown list of all the data available, and switch the graph when a different item is chosen from the list. Differential Revision: https://phabricator.services.mozilla.com/D35757
python/mozbuild/mozbuild/resources/html-build-viewer/index.html
--- a/python/mozbuild/mozbuild/resources/html-build-viewer/index.html
+++ b/python/mozbuild/mozbuild/resources/html-build-viewer/index.html
@@ -427,17 +427,24 @@ function renderResources(id, resources, 
     ;
 }
 
 document.addEventListener("DOMContentLoaded", function() {
   d3.json("list", function onList(error, response) {
     if (!response || !("files" in response)) {
       return;
     }
-
+    if (response.files.length > 1) {
+      var list = d3.select("#list");
+      for (file of response.files) {
+        list.append("option").attr("value", file).text(file);
+      }
+      list.on("change", function() {renderKey(this.value);})
+      list.style("display", "inline");
+    }
     renderKey(response.files[0]);
   });
 }, false);
 
     </script>
     <h3>Build Resource Usage Report</h3>
 
     <div id="tooltip" style="display: none;">
@@ -453,16 +460,17 @@ document.addEventListener("DOMContentLoa
       <option value="cpu">CPU</option>
       <option value="io_count">Disk I/O Count</option>
       <option value="io_bytes">Disk I/O Bytes</option>
       <option value="io_time">Disk I/O Time</option>
       <option value="virt">Memory</option>
     </select>
     -->
 
+    <select id="list" style="display: none"></select>
     <div id="resource_graph"></div>
     <div id="summary" style="padding-top: 20px">
       <table border="0">
         <tr><td>Wall Time (s)</td><td id="wall_time"></td></tr>
         <tr><td>Start Date</td><td id="start_date"></td></tr>
         <tr><td>End Date</td><td id="end_date"></td></tr>
         <tr><td>CPU %</td><td id="cpu_percent"></td></tr>
         <tr><td>Write Bytes</td><td id="write_bytes"></td></tr>