[llvm-commits] [zorg] r151206 - in /zorg/trunk/lnt/lnt/server: reporting/runs.py ui/templates/v4_run.html ui/views.py
Daniel Dunbar
daniel at zuster.org
Wed Feb 22 14:28:13 PST 2012
Author: ddunbar
Date: Wed Feb 22 16:28:13 2012
New Revision: 151206
URL: http://llvm.org/viewvc/llvm-project?rev=151206&view=rev
Log:
[lnt] lnt.server.ui.views/run overview: Avoid unnecessary reload of the
comparison window.
Modified:
zorg/trunk/lnt/lnt/server/reporting/runs.py
zorg/trunk/lnt/lnt/server/ui/templates/v4_run.html
zorg/trunk/lnt/lnt/server/ui/views.py
Modified: zorg/trunk/lnt/lnt/server/reporting/runs.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/reporting/runs.py?rev=151206&r1=151205&r2=151206&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/reporting/runs.py (original)
+++ zorg/trunk/lnt/lnt/server/reporting/runs.py Wed Feb 22 16:28:13 2012
@@ -13,7 +13,7 @@
def generate_run_report(run, baseurl, only_html_body = False,
num_comparison_runs = 10, result = None,
- compare_to = None):
+ compare_to = None, comparison_window = None):
"""
generate_run_report(...) -> (str: subject, str: text_report,
str: html_report)
@@ -31,8 +31,9 @@
machine_parameters = machine.parameters
# Gather the runs to use for statistical data.
- comparison_window = list(ts.get_previous_runs_on_machine(
- run, num_comparison_runs))
+ if comparison_window is None:
+ comparison_window = list(ts.get_previous_runs_on_machine(
+ run, num_comparison_runs))
# Get the specific run to compare to.
if compare_to is None and comparison_window:
Modified: zorg/trunk/lnt/lnt/server/ui/templates/v4_run.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/templates/v4_run.html?rev=151206&r1=151205&r2=151206&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/templates/v4_run.html (original)
+++ zorg/trunk/lnt/lnt/server/ui/templates/v4_run.html Wed Feb 22 16:28:13 2012
@@ -228,7 +228,7 @@
for field in primary_fields
%}{%
set cr = request_info.sri.get_run_comparison_result(
- run, compare_to, test_id, field, comparison_window)
+ run, compare_to, test_id, field, request_info.comparison_window)
%} {{cr.previous}} {{cr.current}} {{cr.pct_delta}}{%
endfor %}
{%
Modified: zorg/trunk/lnt/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/server/ui/views.py?rev=151206&r1=151205&r2=151206&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/server/ui/views.py (original)
+++ zorg/trunk/lnt/lnt/server/ui/views.py Wed Feb 22 16:28:13 2012
@@ -782,10 +782,21 @@
self.compare_to = None
self.comparison_neighboring_runs = self.neighboring_runs
+ try:
+ self.num_comparison_runs = int(
+ request.args.get('num_comparison_runs'))
+ except:
+ self.num_comparison_runs = 10
+
+ # Gather the runs to use for statistical data.
+ self.comparison_window = list(ts.get_previous_runs_on_machine(
+ self.run, self.num_comparison_runs))
+
reports = lnt.server.reporting.runs.generate_run_report(
self.run, baseurl=db_url_for('index', _external=True),
- only_html_body=only_html_body,
- result=None, compare_to=self.compare_to)
+ only_html_body=only_html_body, result=None,
+ compare_to=self.compare_to,
+ comparison_window=self.comparison_window)
_, self.text_report, self.html_report, self.sri = reports
@v4_route("/<int:id>/report")
@@ -821,11 +832,7 @@
options['show_data_table'] = bool(request.args.get('show_data_table'))
options['hide_report_by_default'] = bool(
request.args.get('hide_report_by_default'))
- try:
- num_comparison_runs = int(request.args.get('num_comparison_runs'))
- except:
- num_comparison_runs = 10
- options['num_comparison_runs'] = num_comparison_runs
+ options['num_comparison_runs'] = info.num_comparison_runs
options['test_filter'] = test_filter_str = request.args.get(
'test_filter', '')
if test_filter_str:
@@ -840,10 +847,6 @@
else:
test_min_value_filter = 0.0
- # Gather the runs to use for statistical data.
- comparison_window = list(ts.get_previous_runs_on_machine(
- run, num_comparison_runs))
-
# Get the test names.
test_info = ts.query(ts.Test.name, ts.Test.id).\
order_by(ts.Test.name).all()
@@ -857,7 +860,6 @@
return render_template(
"v4_run.html", ts=ts, options=options,
primary_fields=list(ts.Sample.get_primary_fields()),
- comparison_window=comparison_window,
test_info=test_info, runinfo=runinfo,
test_min_value_filter=test_min_value_filter,
request_info=info)
More information about the llvm-commits
mailing list