[llvm-commits] [LNT] r161849 - in /lnt/trunk/lnt/server/ui: static/v4_global_status.js templates/v4_global_status.html
Michael Gottesman
mgottesman at apple.com
Mon Aug 13 21:21:36 PDT 2012
Author: mgottesman
Date: Mon Aug 13 23:21:35 2012
New Revision: 161849
URL: http://llvm.org/viewvc/llvm-project?rev=161849&view=rev
Log:
[LNT] v4_global_status: Finished the updating of worst time.
Modified:
lnt/trunk/lnt/server/ui/static/v4_global_status.js
lnt/trunk/lnt/server/ui/templates/v4_global_status.html
Modified: lnt/trunk/lnt/server/ui/static/v4_global_status.js
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/static/v4_global_status.js?rev=161849&r1=161848&r2=161849&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/static/v4_global_status.js (original)
+++ lnt/trunk/lnt/server/ui/static/v4_global_status.js Mon Aug 13 23:21:35 2012
@@ -1,5 +1,9 @@
// -*- mode: javascript; -*-
+String.prototype.pctToFloat = function() {
+ return parseFloat(this.slice(0,-1));
+};
+
v4_global_status = {};
(function(_module) {
// Assign our input module to a var so that a closure is created
@@ -44,8 +48,9 @@
// We serve up our results sorted correctly since sorttable.js does not
// sort on page load (which is most likely done for performance reasons, I
// guess?). The problem is that we do not have an initial arrow pointing up
- // or down. So we hack the arrow in.
+ // or down. So we hack the arrow in.
var initial_sort_header = document.getElementById('worst-time-header');
+ initial_sort_header.className += ' sorttable_sorted_reverse';
sortrevind = document.createElement('span');
sortrevind.id = "sorttable_sortrevind";
sortrevind.innerHTML = ' ▾';
@@ -56,12 +61,12 @@
'contextMenu-runpage' : function(elt) {
var new_base = elt.getAttribute('run_id') + '/graph?test.';
- field = getQueryParameterByName('field');
+ field = GetQueryParameterByName('field');
if (field == "")
field = 2; // compile time.
new_base += elt.getAttribute('test_id') + '=' + field.toString();
- window.location = url_replace_basename(window.location.toString(),
+ window.location = UrlReplaceBasename(window.location.toString(),
new_base);
}
}
@@ -70,7 +75,7 @@
/* Helper Functions */
- function url_replace_basename(url, new_basename) {
+ function UrlReplaceBasename(url, new_basename) {
// Remove query string.
var last_question_index = url.lastIndexOf('?');
if (last_question_index != -1)
@@ -83,7 +88,7 @@
return without_base + new_basename;
}
- function getQueryParameterByName(name) {
+ function GetQueryParameterByName(name) {
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
var regexS = "[\\?&]" + name + "=([^&#]*)";
var regex = new RegExp(regexS);
@@ -92,7 +97,11 @@
return "";
else
return decodeURIComponent(results[1].replace(/\+/g, " "));
- }
+ }
+
+ function IsHidden(elem) {
+ return elem.offsetWidth === 0 && elem.offsetHeight === 0;
+ }
/* Exported Functions */
@@ -147,7 +156,31 @@
};
m.recompute_worst_times = function() {
+ $('#data-table tr.data-row').each(function(index, value) {
+ var cells = value.cells;
+ var i = 2, length = cells.length;
+ var max = -Infinity;
+ var max_index = -1;
+ for (; i < length; i++) {
+ // We only consider visible cells.
+ if (IsHidden(cells[i]))
+ continue;
+
+ var flt = cells[i].innerHTML.pctToFloat();
+ if (max < flt) {
+ max = flt;
+ max_index = i;
+ }
+ }
+
+ cells[1].innerHTML = (max != -Infinity)? max.toString() + '%' : "";
+ cells[1].setAttribute('bgcolor', (max_index != -1)? cells[max_index].getAttribute('bgcolor') : "#dbdbdb");
+ });
+ // Resort.
+ var initial_sort_header = document.getElementById('worst-time-header');
+ initial_sort_header.className = initial_sort_header.className.replace('sorttable_sorted_reverse','').replace('sorttable_sorted','');
+ $(initial_sort_header).trigger('click');
};
})(v4_global_status);
Modified: lnt/trunk/lnt/server/ui/templates/v4_global_status.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_global_status.html?rev=161849&r1=161848&r2=161849&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_global_status.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_global_status.html Mon Aug 13 23:21:35 2012
@@ -145,7 +145,7 @@
</tr>
{% for row in tests %}
{% set outer_index = loop.index0 %}
- <tr>
+ <tr class="data-row">
<td class="row-head">
{{ row[0][1] }}
</td>
More information about the llvm-commits
mailing list