[LNT] r255950 - Regression tracking interface tweaks

Chris Matthews via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 17 17:14:45 PST 2015


Author: cmatthews
Date: Thu Dec 17 19:14:45 2015
New Revision: 255950

URL: http://llvm.org/viewvc/llvm-project?rev=255950&view=rev
Log:
Regression tracking interface tweaks

Modified:
    lnt/trunk/lnt/server/ui/static/lnt_graph.js
    lnt/trunk/lnt/server/ui/templates/layout.html
    lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html

Modified: lnt/trunk/lnt/server/ui/static/lnt_graph.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/lnt_graph.js?rev=255950&r1=255949&r2=255950&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/lnt_graph.js (original)
+++ lnt/trunk/lnt/server/ui/static/lnt_graph.js Thu Dec 17 19:14:45 2015
@@ -3,7 +3,7 @@
 var data_cache = [];
 var is_checked = []; // The current list of lines to plot.
 var normalize = false;
-
+var MAX_TO_DRAW = 25;
 
 function try_normal(data_array, end_rev) {
     $("#graph_range").prop("min", 0);
@@ -77,16 +77,19 @@ var color_codes = ["#4D4D4D",
 
 function new_graph_data_callback(data, index) {
     data_cache[index] = data;
-    is_checked[index] = true;
     update_graph();
 }
 
+NOT_DRAWING = '<div class="alert alert-success" role="alert">' +
+            'Too many to graph.<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>' + 
+                        '</div>';
 function update_graph() {
     var to_draw = [];
     var starts = [];
     var ends = [];
     for ( var i = 0; i < changes.length; i++) {
-            if (is_checked[i]) {
+            
+            if (is_checked[i] && data_cache[i]) {
                     starts.push(changes[i].start);
                     ends.push(changes[i].end);
                     var color = color_codes[i % color_codes.length];
@@ -99,3 +102,17 @@ function update_graph() {
     var highest_rev = Math.max.apply(Math, ends);
     init(to_draw, lowest_rev, highest_rev);    
 }
+
+// To be called by main page. It will fetch data and make graph ready.
+function add_data_to_graph(URL, index) {
+    var current_to_draw = is_checked.filter(function(x){ return x; }).length
+    if (current_to_draw > MAX_TO_DRAW) {
+        $('#errors').empty().prepend(NOT_DRAWING);
+        is_checked[index] = true;
+        return;
+    }
+    $.getJSON(URL, function(data) {
+        new_graph_data_callback(data, index);
+        });
+    is_checked[index] = true;
+}

Modified: lnt/trunk/lnt/server/ui/templates/layout.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/layout.html?rev=255950&r1=255949&r2=255950&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/layout.html (original)
+++ lnt/trunk/lnt/server/ui/templates/layout.html Thu Dec 17 19:14:45 2015
@@ -181,6 +181,7 @@
 
         {# Page Content #}
         <div id="content" class="container-fluid">
+            <div id="errors"></div>
             {% with messages = get_flashed_messages(with_categories=true) %}
                 {% if messages %}
                     {% for category, message in messages %}

Modified: lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html?rev=255950&r1=255949&r2=255950&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_new_regressions.html Thu Dec 17 19:14:45 2015
@@ -209,7 +209,7 @@ function update_tooltip(event, pos, item
   
   <thead>
   <tr>
-    <th><button id="clear" type="button" class="btn btn-default" style="width:100%;text-align:center;" onclick="clear_checks()">X</button></th>
+    <th>X</th>
     <th>Machine</th>
     <th>Metric</th>
     <th>Test</th>
@@ -251,9 +251,11 @@ function update_tooltip(event, pos, item
     {% endfor %}
   </tbody>
 </table>
-
-    <input name="btn" type="submit" value="Create New Regression">
-    <input name="btn" type="submit" value="Ignore Changes">
+<button id="all" type="button" class="btn btn-default" onclick="show_all()">Show All</button>
+    <button id="all" type="button" class="btn btn-default" onclick="all_checks()">Check Visable</button>
+    <button id="clear" type="button" class="btn btn-default" onclick="clear_checks()">Clear Visable</button>
+    <input name="btn" type="submit" value="Create New Regression" onclick="show_all()">
+    <input name="btn" type="submit" value="Ignore Changes" onclick="show_all()">
 
 </form>
 
@@ -265,36 +267,47 @@ function clear_checks() {
      $('input:checkbox').trigger('change');
 }
 
+function all_checks() {
+     $('input:checkbox').prop('checked','checked');
+     $('input:checkbox').trigger('change');
+}
+
+function show_all() {
+    dt.page.len(-1).draw();
+}
+
 function register_checkboxes() {
     $(':checkbox').change(function(){
           var c = this.checked
           var id = this.id;
           var index = id.split("-")[1];
-          
           if (c) {
               var color = color_codes[index % color_codes.length];
               var prev_cell = $(this).closest('td').prev();
               prev_cell.css("background-color", color);
-              $.getJSON(changes[index]["url"], function(data) {
-                  new_graph_data_callback(data, index);
-                  });
+              add_data_to_graph(changes[index]["url"], index);
           } else {
               is_checked[index] = false;
               var prev_cell = $(this).closest('td').prev();
               prev_cell.css("background-color", "transparent");
+              update_graph();
           }
-          update_graph();
+          
       });
+    $(':checkbox').css("-webkit-transform", "scale(2)");
   }
-
+var dt = null;
 $(document).ready( function () {
-    $('#changes_table').DataTable({
-    "sDom": '<"top"if>rt<"bottom"Flp>',
+    dt = $('#changes_table').DataTable({
+    "dom": '<"top"if>rt<"bottom"Flp>',
     "drawCallback": function( settings ) {
         register_checkboxes();
-    }
-  });
-  
+    },
+    "aLengthMenu": [
+        [25, 50, 100, 200, -1],
+        [25, 50, 100, 200, "All"]],
+});
+
   for (var i = 0; i < changes.length; i++) {
       is_checked[i] = false;
   }




More information about the llvm-commits mailing list