[Lsb-messages] /var/www/bzr/lsb/devel/buildbot-config r333: More tweaks to buildbot home page JavaScript.

Jeff Licquia licquia at linuxfoundation.org
Mon Jul 29 22:44:35 UTC 2013


------------------------------------------------------------
revno: 333
committer: Jeff Licquia <licquia at linuxfoundation.org>
branch nick: buildbot-config
timestamp: Mon 2013-07-29 18:44:35 -0400
message:
  More tweaks to buildbot home page JavaScript.
  
   - Drop the load intervals for multiple builders from 1 second to 0.1
     seconds; when loading the entire page at start, 1 second is too slow.
  
   - Switch default for builder cell entries.
  
   - Add an error condition for when a builder's data can't be loaded.
  
   - Fix bug in calculating appropriate next update time for a builder
     cell.
modified:
  public_html/newinterface.js
-------------- next part --------------
=== modified file 'public_html/newinterface.js'
--- a/public_html/newinterface.js	2013-07-29 21:47:32 +0000
+++ b/public_html/newinterface.js	2013-07-29 22:44:35 +0000
@@ -29,21 +29,21 @@
 
 function load_slaveinfo(data) {
     var items = "";
-    var load_interval = 1;
+    var load_interval = 0.1;
     for (var item in data) {
         if (item.substr(0, 7) == "lfbuild") {
             var arch = item.substr(8);
             var connecttype;
             if (!data[item]["connected"]) {
                 connecttype = "offline";
-            } else if (data[item]["runningBuilds"].length == 0) {
-                connecttype = "idle";
-            } else {
+            } else if (data[item]["runningBuilds"].length > 0) {
                 connecttype = "running";
                 var buildItem = data[item]["runningBuilds"][0];
                 set_builder_refresh(buildItem["builderName"],
                                     load_interval * 1000);
-                load_interval = load_interval + 1;
+                load_interval = load_interval + 0.1;
+            } else {
+                connecttype = "idle";
             }
 	    $("#heading-" + arch).html(arch + "<br />" + connecttype).attr("class", connecttype);
         }
@@ -62,7 +62,7 @@
 function create_status_table(data) {
     var archs = new Array();
     var projects = new Object();
-    var load_interval = 1;
+    var load_interval = 0.1;
     for (var item in data) {
         if (item.substr(0, 7) == "lfbuild") {
             var arch = item.substr(8);
@@ -91,7 +91,7 @@
             if (arch in projects[project]) {
                 arch_item = projects[project][arch];
                 set_builder_refresh(builder, load_interval * 1000);
-                load_interval = load_interval + 1;
+                load_interval = load_interval + 0.1;
             } else {
                 arch_item = "&nbsp;";
             }
@@ -148,7 +148,7 @@
                     status_desc = "<a href='builders/" + builder
                         + "'>" + timediff_desc + "</a>";
                     status_class = "success";
-                    var timediff = build_end - now;
+                    var timediff = now - build_end;
                     var nextrun;
                     if (timediff < 300) {
                         nextrun = 1;
@@ -169,6 +169,10 @@
                 }
                 $("#" + builder).html(status_desc).attr('class', status_class);
             },
+            error: function() {
+                $("#" + builder).html("error getting status").attr('class', 'none');
+                set_builder_refresh(builder, 15000);
+            },
         });
 }
 



More information about the lsb-messages mailing list