[LNT] r239470 - Run page regex search: only search for matches with benchmark names, not with other data in the table.
Kristof Beyls
kristof.beyls at arm.com
Wed Jun 10 05:19:08 PDT 2015
Author: kbeyls
Date: Wed Jun 10 07:19:08 2015
New Revision: 239470
URL: http://llvm.org/viewvc/llvm-project?rev=239470&view=rev
Log:
Run page regex search: only search for matches with benchmark names, not with other data in the table.
Modified:
lnt/trunk/lnt/server/ui/templates/reporting/runs.html
lnt/trunk/lnt/server/ui/templates/utils.html
lnt/trunk/lnt/server/ui/templates/v4_run.html
Modified: lnt/trunk/lnt/server/ui/templates/reporting/runs.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/runs.html?rev=239470&r1=239469&r2=239470&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/runs.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/runs.html Wed Jun 10 07:19:08 2015
@@ -19,7 +19,8 @@
{% if not show_perf %}
<tbody class="searchable">
{% for name in test_names %}
- <tr><td style="{{ styles['td'] }}">{{ name }}</td></tr>
+ <tr><td class="benchmark-name" style="{{ styles['td'] }}">
+ {{ name }}</td></tr>
{% endfor %}
</tbody>
{% else %}
@@ -36,7 +37,7 @@
{% for name, cr, test_id in bucket %}
<tr>
- <td style="{{ styles['td'] }}">
+ <td class="benchmark-name" style="{{ styles['td'] }}">
<a href="{{ run_url }}/graph?{{ [('test.%d' % test_id, field_index)] | urlencode }}">{{ name }}</a>
</td>
{{ cr.pct_delta|aspctcell(style=styles['td'],reverse=cr.bigger_is_better)|safe }}
Modified: lnt/trunk/lnt/server/ui/templates/utils.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/utils.html?rev=239470&r1=239469&r2=239470&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/utils.html (original)
+++ lnt/trunk/lnt/server/ui/templates/utils.html Wed Jun 10 07:19:08 2015
@@ -22,20 +22,26 @@
<a href="{{v4_url_for('v4_machine', id=m.id)}}">{{m.name}}:{{m.id}}</a>
{%- endmacro %}
-{% macro regex_filter_box(input_id, selector, placeholder) -%}
+{% macro regex_filter_box(input_id, selector, placeholder,
+ selector_part_to_search=None) -%}
<div class="input-group"> <span class="input-group-addon">Filter</span>
<input id="{{input_id}}" type="text" class="form-control"
placeholder="{{placeholder}}"/>
</div>
<script type="text/javascript">
-// Filter table by filter text box.
$(document).ready(function() {
(function ($) {
$('#{{input_id}}').keyup(function () {
var filter_regex = new RegExp($(this).val(), 'i');
$('{{selector}}').hide();
$('{{selector}}').filter(function () {
- return filter_regex.test($(this).text());
+ var text=
+{% if selector_part_to_search is none %}
+ $(this).text();
+{% else %}
+ $(this).find("{{selector_part_to_search|safe}}").text();
+{% endif %}
+ return filter_regex.test(text);
}).show();
})
}(jQuery));
Modified: lnt/trunk/lnt/server/ui/templates/v4_run.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_run.html?rev=239470&r1=239469&r2=239470&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_run.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_run.html Wed Jun 10 07:19:08 2015
@@ -288,7 +288,8 @@
{{ utils.regex_filter_box(input_id='filter',
selector='.searchable tr',
- placeholder="Benchmark name regex...") }}
+ placeholder="Benchmark name regex...",
+ selector_part_to_search=".benchmark-name") }}
{{request_info.html_report|safe}}
{{ utils.render_popup_end() }}
@@ -330,7 +331,7 @@
{% for test_name,test_id,cr in tests %}
<tr>
<td><input type="checkbox" name="plot.{{test_id}}" value="{{machine.id}}.{{test_id}}.{{field.index}}"></td>
- <td><a href="{{graph_base}}&plot.{{test_id}}={{ machine.id}}.{{test_id}}.{{field.index}}">{{ test_name }}</a></td>
+ <td class="benchmark-name"><a href="{{graph_base}}&plot.{{test_id}}={{ machine.id}}.{{test_id}}.{{field.index}}">{{ test_name }}</a></td>
{{ get_cell_value(cr) }}
</tr>
{% endfor %}
@@ -368,7 +369,7 @@
<tbody class="searchable">
{% for test_name,test_id in test_info %}
<tr>
- <td>{{ test_name }}</td>
+ <td class="benchmark-name">{{ test_name }}</td>
{% for field in primary_fields %}
{% set cr = request_info.sri.get_run_comparison_result(run, compare_to, test_id, field) %}
<td>{{cr.previous}}</td>
More information about the llvm-commits
mailing list