Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bug 823135: Show build load in trychooser webpage. r=bhearsum

  • Loading branch information...
commit 1657a6673c1f9b92f85772ec504f5d88080144a0 1 parent 1113c6a
Benoit Girard authored
View
77 trychooser/index.html
@@ -3,6 +3,7 @@
<title>TryChooser Syntax Builder</title>
<link href="jquery-ui.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="jquery.min.js"></script>
+<script type="text/javascript" src="tryload.js"></script>
<script type="text/javascript" src="trychooser.js"></script>
<link rel="shortcut icon" href="favicon.ico">
<link rel="stylesheet" type="text/css" href="trychooser.css">
@@ -39,17 +40,71 @@
<label><input type="checkbox" class="group-selector none-selector">Clear All</label>
<ul>
- <li><label><input type="checkbox" name="platform" value="linux">linux</label></li>
- <li><label><input type="checkbox" name="platform" value="linux64">linux64</label></li>
- <li><label><input type="checkbox" name="platform" value="macosx64">macosx64</label></li>
- <li><label><input type="checkbox" name="platform" value="win32">win32</label></li>
- <li><label><input type="checkbox" name="platform" value="android">android</label></li>
- <li><label><input type="checkbox" name="platform" value="android-armv6">android-armv6</label></li>
- <li><label><input type="checkbox" name="platform" value="android-noion">android-noion</label></li>
- <li><label><input type="checkbox" name="platform" value="ics_armv7a_gecko">ics_armv7a_gecko (B2G emulator)</label></li>
- <li><label><input type="checkbox" name="platform" value="panda">panda (B2G automation board)</label></li>
- <li><label><input type="checkbox" name="platform" value="otoro">otoro (B2G device image)</label></li>
- <li><label><input type="checkbox" name="platform" value="unagi">unagi (B2G device image)</label></li>
+ <li>
+ <label>Platform</label>
+ <span id="test_header" class="test_queue">Test</span>
+ <span id="build_header" class="build_queue">Build</span>
+ </li>
+ <li>
+ <label>&nbsp;</label>
+ <span id="test_header2" class="test_queue">Queue</span>
+ <span id="build_header2" class="build_queue">Queue</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="linux">linux</label>
+ <span id="test_linux" class="test_queue">N/A</span>
+ <span id="build_linux" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="linux64">linux64</label>
+ <span id="test_linux64" class="test_queue">N/A</span>
+ <span id="build_linux64" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="macosx64">macosx64</label>
+ <span id="test_macosx64" class="test_queue">N/A</span>
+ <span id="build_macosx64" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="win32">win32</label>
+ <span id="test_win32" class="test_queue">N/A</span>
+ <span id="build_win32" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="android">android</label>
+ <span id="test_android" class="test_queue">N/A</span>
+ <span id="build_android" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="android-armv6">android-armv6</label>
+ <span id="test_android-armv6" class="test_queue">N/A</span>
+ <span id="build_android-armv6" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="android-noion">android-noion</label>
+ <span id="test_android-noion" class="test_queue">N/A</span>
+ <span id="build_android-noion" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="ics_armv7a_gecko">ics_armv7a_gecko (B2G emulator)</label>
+ <span id="test_ics_armv7a_gecko" class="test_queue">N/A</span>
+ <span id="build_ics_armv7a_gecko" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="panda">panda (B2G automation board)</label>
+ <span id="test_panda" class="test_queue">N/A</span>
+ <span id="build_panda" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="otoro">otoro (B2G device image)</label>
+ <span id="test_otoro" class="test_queue">N/A</span>
+ <span id="build_otoro" class="build_queue">N/A</span>
+ </li>
+ <li>
+ <label><input type="checkbox" name="platform" value="unagi">unagi (B2G device image)</label>
+ <span id="test_unagi" class="test_queue">N/A</span>
+ <span id="build_unagi" class="build_queue">N/A</span>
+ </li>
</ul>
</span>
View
14 trychooser/trychooser.css
@@ -35,7 +35,7 @@ label {
}
#col1 {
float:left;
- width:350px;
+ width:450px;
padding: 5px;
}
#col2 {
@@ -54,4 +54,14 @@ label {
h4 {
background: lightgray;
-}
+}
+
+.build_queue {
+ float: right;
+ width: 55px;
+}
+
+.test_queue {
+ float: right;
+ width: 55px;
+}
View
137 trychooser/tryload.js
@@ -0,0 +1,137 @@
+var TRY_BUILD_LOAD_URL = "http://build.mozilla.org/builds/pending/pending_compile_try.txt";
+var TRY_TEST_LOAD_URL = "http://build.mozilla.org/builds/pending/pending_test_try.txt";
+var NONTRY_TEST_LOAD_URL = "http://build.mozilla.org/builds/pending/pending_test_nontry.txt";
+
+function initLoad() {
+ return {
+ "linux": 0,
+ "linux64": 0,
+ "linux-hp": 0,
+ "macosx64": 0,
+ "mac10.6-rev4": 0,
+ "mac10.7": 0,
+ "mac10.8": 0,
+ "macosx64": 0,
+ "win32": 0,
+ "winxp": 0,
+ "win7": 0,
+ "win64": 0,
+ "android": 0,
+ "ics_armv7a_gecko": 0,
+ "android-armv6": 0,
+ "android-noion": 0,
+ "tegra": 0,
+ "panda": 0,
+ "otoro": 0,
+ "unagi": 0,
+ };
+}
+
+function getTryLoad(url, callback) {
+ var oXHR = new XMLHttpRequest();
+ oXHR.onreadystatechange = function (e) {
+ if (oXHR.readyState === 4 && (oXHR.status === 200 || oXHR.status === 0)) {
+ var loadText = oXHR.responseText;
+ var loadLines = loadText.split("\n");
+ var load = initLoad();
+ for (var i in loadLines) {
+ var line = loadLines[i];
+ var words = loadLines[i].split(" ");
+ if (words.length == 2 && words[1].charAt(0) == "(" && words[1].charAt(words[1].length-1) == ")") {
+ load[words[0]] = parseInt(words[1].substring(1, words[1].length - 1));
+ }
+ }
+ callback(load);
+ }
+ }
+ oXHR.open("GET", url, true);
+ oXHR.responseType = "text";
+ oXHR.send(null);
+}
+
+function getTryLoads(callback) {
+ getTryLoad(TRY_BUILD_LOAD_URL, function(load_try_build) {
+ getTryLoad(TRY_TEST_LOAD_URL, function(load_try_test) {
+ getTryLoad(NONTRY_TEST_LOAD_URL, function(load_nontry_test) {
+ var totalBuildLoad = {};
+ totalBuildLoad["linux"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["linux64"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["macosx64"] = load_try_build["macosx64"];
+ totalBuildLoad["win32"] = load_try_build["win32"] + load_try_build["win64"];
+ totalBuildLoad["android"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["android-armv6"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["android-noion"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["ics_armv7a_gecko"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["panda"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["otoro"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+ totalBuildLoad["unagi"] = load_try_build["linux"] + load_try_build["linux64"] + load_try_build["linux-hp"];
+
+ var totalTestLoad = {};
+ totalTestLoad["linux"] = load_try_test["linux"] + load_nontry_test["linux"];
+ totalTestLoad["linux64"] = load_try_test["linux64"] + load_nontry_test["linux64"];
+ totalTestLoad["macosx64"] = Math.max(
+ Math.max(
+ load_try_test["mac10.6-rev4"] + load_nontry_test["mac10.6-rev4"],
+ load_try_test["mac10.7"] + load_nontry_test["mac10.7"])
+ , load_try_test["mac10.8"] + load_nontry_test["mac10.8"]);
+ totalTestLoad["win32"] = Math.max(
+ load_try_test["winxp"] + load_nontry_test["winxp"],
+ load_try_test["win7"] + load_nontry_test["win7"]);
+ totalTestLoad["android"] = Math.max(
+ load_try_test["tegra"] + load_nontry_test["tegra"],
+ load_try_test["panda"] + load_nontry_test["panda"]);
+ totalTestLoad["android-armv6"] = load_try_test["tegra"] + load_nontry_test["tegra"];
+ totalTestLoad["android-noion"] = load_try_test["tegra"] + load_nontry_test["tegra"];
+ totalTestLoad["ics_armv7a_gecko"] = load_try_test["linux"] + load_nontry_test["linux"];
+ totalTestLoad["panda"] = load_try_test["panda"] + load_nontry_test["panda"];
+ // otoro / unagi: N/A
+ callback(totalBuildLoad, totalTestLoad);
+ });
+ });
+ });
+}
+
+function showTryLoads() {
+ getTryLoads(function showLoads(totalBuildLoad, totalTestLoad) {
+ for (var platform in totalBuildLoad) {
+ var load = totalBuildLoad[platform]
+ console.log("build load for: " + platform);
+ if (load == undefined) {
+ console.log("Load for platform '" + platform + "' not defined. Skipping.");
+ continue;
+ }
+
+ var elemId = "build_" + platform;
+ var elem = document.getElementById(elemId);
+ if (!elem) {
+ console.log("Element '" + elemId + "' not found. Skipping.");
+ continue;
+ }
+
+ console.log("build load for: " + platform + ", " + load);
+ elem.textContent = load;
+ elem.style.color = "rgb(" + Math.min(Math.round((load/500.0) * 255), 255) + ",0,0)";
+ }
+ for (var platform in totalTestLoad) {
+ var load = totalTestLoad[platform]
+ if (load == undefined) {
+ console.log("Load for platform '" + platform + "' not defined. Skipping.");
+ continue;
+ }
+
+ var elemId = "test_" + platform;
+ var elem = document.getElementById(elemId);
+ if (!elem) {
+ console.log("Element '" + elemId + "' not found. Skipping.");
+ continue;
+ }
+
+ elem.textContent = load;
+ elem.style.color = "rgb(" + Math.min(Math.round((load/500.0) * 255), 255) + ",0,0)";
+ }
+ });
+}
+
+window.addEventListener('load', function() {
+ showTryLoads();
+}, false);
Please sign in to comment.
Something went wrong with that request. Please try again.