[llvm-commits] [LNT] r161334 - in /lnt/trunk/lnt/server: config.py ui/templates/browse.html ui/templates/machine.html ui/templates/run.html ui/templates/simple_graph.html ui/templates/simple_machine.html ui/templates/simple_order_aggregate_report.html ui/templates/simple_overview.html ui/templates/simple_run.html ui/templates/simple_utils.html ui/templates/test.html ui/views.py
Daniel Dunbar
daniel at zuster.org
Mon Aug 6 13:02:45 PDT 2012
Author: ddunbar
Date: Mon Aug 6 15:02:44 2012
New Revision: 161334
URL: http://llvm.org/viewvc/llvm-project?rev=161334&view=rev
Log:
Remove UI support for v0.3 databases.
Removed:
lnt/trunk/lnt/server/ui/templates/browse.html
lnt/trunk/lnt/server/ui/templates/machine.html
lnt/trunk/lnt/server/ui/templates/run.html
lnt/trunk/lnt/server/ui/templates/simple_graph.html
lnt/trunk/lnt/server/ui/templates/simple_machine.html
lnt/trunk/lnt/server/ui/templates/simple_order_aggregate_report.html
lnt/trunk/lnt/server/ui/templates/simple_overview.html
lnt/trunk/lnt/server/ui/templates/simple_run.html
lnt/trunk/lnt/server/ui/templates/simple_utils.html
lnt/trunk/lnt/server/ui/templates/test.html
Modified:
lnt/trunk/lnt/server/config.py
lnt/trunk/lnt/server/ui/views.py
Modified: lnt/trunk/lnt/server/config.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/config.py?rev=161334&r1=161333&r2=161334&view=diff
==============================================================================
--- lnt/trunk/lnt/server/config.py (original)
+++ lnt/trunk/lnt/server/config.py Mon Aug 6 15:02:44 2012
@@ -121,10 +121,8 @@
return None
# Instantiate the appropriate database version.
- if db_entry.db_version == '0.3':
- return lnt.db.perfdb.PerfDB(db_entry.path, echo=echo)
if db_entry.db_version == '0.4':
return lnt.server.db.v4db.V4DB(db_entry.path, echo=echo)
- raise NotImplementedError,"unable to import to version %r database" % (
+ raise NotImplementedError,"unable to load version %r database" % (
db_entry.db_version,)
Removed: lnt/trunk/lnt/server/ui/templates/browse.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/browse.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/browse.html (original)
+++ lnt/trunk/lnt/server/ui/templates/browse.html (removed)
@@ -1,59 +0,0 @@
-{% extends "layout.html" %}
-{% set components = [] %}
-{% block title %}Database Browser{% endblock %}
-{% block body %}
-
-{% set db = request.get_db() %}
-<h3>Machines</h3>
-<table class="sortable" border=1 cellborder=1>
- <thead>
- <tr>
- <th>Name</th>
- </tr>
- </thead>
-{% for m in db.machines() %}
- <tr>
- <td><a href="machines/{{m.id}}/">{{m.name}}:{{m.number}}</a></td>
- </tr>
-{% endfor %}
-</table>
-
-{# List runs. #}
-<h3>Run List</h3>
-<table class="sortable" border=1 cellborder=1>
- <thead>
- <tr>
- <th>ID</th>
- <th>Machine</th>
- <th>Start Time</th>
- <th>End Time</th>
- </tr>
- </thead>
-{% for r,m in db.query(perfdb.Run, perfdb.Machine).join(perfdb.Machine) %}
- <tr>
- <td><a href="runs/{{r.id}}/">{{r.id}}</a></td>
- <td><a href="machines/{{m.machine_id}}/">{{m.name}}:{{m.number}}</a></td>
- <td>{{r.start_time}}</td>
- <td>{{r.end_time}}</td>
- </tr>
-{% endfor %}
-</table>
-
-{# List tests. #}
-<h3>Test List</h3>
-<table class="sortable" border=1 cellborder=1>
- <thead>
- <tr>
- <th>ID</th>
- <th>Test</th>
- </tr>
- </thead>
-{% for id,name in db.query(perfdb.Test.id, perfdb.Test.name) %}
- <tr>
- <td><a href="tests/{{id}}/">{{id}}</a></td>
- <td>{{name}}</td>
- </tr>
-{% endfor %}
-</table>
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/machine.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/machine.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/machine.html (original)
+++ lnt/trunk/lnt/server/ui/templates/machine.html (removed)
@@ -1,43 +0,0 @@
-{% set db = request.get_db() %}
-{% set machine = db.getMachine(id) %}
-
-{% extends "layout.html" %}
-{% set components = [("browse", db_url_for("browse"))] %}
-{% block title %}Machine: {{machine.name}}:{{machine.number}}{% endblock %}
-{% block body %}
-
-{# Show the machine info dictionary. #}
-<table border=1 cellborder=1>
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
- </thead>
-{% for mi in machine.info.values() %}
- <tr>
- <td>{{mi.key}}</td>
- <td>{{mi.value}}</td>
- </tr>
-{% endfor %}
-</table>
-
-{# List associated runs. #}
-<h3>Associated Runs</h3>
-<table class="sortable" border=1 cellborder=1>
- <thead>
- <tr>
- <th>Run ID</th>
- <th>Start Time</th>
- <th>End Time</th>
- </tr>
- </thead>
-{% for r in db.runs(machine=machine) %}
- <tr>
- <td><a href="{{db_url_for('run', id=r.id)}}">{{r.id}}</a></td>
- <td>{{r.start_time}}</td>
- <td>{{r.end_time}}</td>
- </tr>
-{% endfor %}
-</table>
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/run.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/run.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/run.html (original)
+++ lnt/trunk/lnt/server/ui/templates/run.html (removed)
@@ -1,41 +0,0 @@
-{% set db = request.get_db() %}
-{% set run = db.getRun(id) %}
-{% set machine = db.getMachine(run.machine_id) %}
-
-{% extends "layout.html" %}
-{% set components = [("browse", db_url_for("browse"))] %}
-{% block title %}Run: {{run.id}}{% endblock %}
-{% block body %}
-
-<table border=1 cellborder=1>
- <tr>
- <th>Machine</th>
- <th>Start Time</th>
- <th>End Time</th>
- </tr>
- </thead>
- <tr>
- <td><a href="{{db_url_for('machine', id=machine.id)}}">{{
- machine.name}}{{machine.number}}</a></td>
- <td>{{run.start_time}}</td>
- <td>{{run.end_time}}</td>
- </tr>
-</table>
-
-{# Show the run info dictionary. #}
-<h3>Run Info</h3>
-<table border=1 cellborder=1>
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
- </thead>
-{% for mi in run.info.values() %}
- <tr>
- <td>{{mi.key}}</td>
- <td>{{mi.value}}</td>
- </tr>
-{% endfor %}
-</table>
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/simple_graph.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/simple_graph.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/simple_graph.html (original)
+++ lnt/trunk/lnt/server/ui/templates/simple_graph.html (removed)
@@ -1,147 +0,0 @@
-{% import "simple_utils.html" as simple_utils %}
-{% import "utils.html" as utils %}
-
-{% set db = request.get_db() %}
-{% set run = db.getRun(id) %}
-{% set machine = run.machine %}
-
-{% extends "layout.html" %}
-{% set components = [(tag, db_url_for("simple_overview", tag=tag)),
- ('machine', db_url_for("simple_machine",
- tag=tag, id=machine.id)),
- ('run', db_url_for("simple_run",
- tag=tag, id=machine.id))] %}
-{% block head %}
- <script src="{{ url_for('.static', filename='popup.js') }}"></script>
- <script src="{{ url_for('.static', filename='sorttable.js') }}"></script>
- <script src="{{ url_for('.static', filename='View2D.js') }}"></script>
-{% endblock %}
-
-{% block title %}Run Results{% endblock %}
-
-{# Add JS to initialize the graph. #}
-{% block onload %}init(){% endblock %}
-{% block javascript %}
-function init() {
- graph = new Graph2D("graph");
- graph.clearColor = [1, 1, 1];
-
- {{ graph_plots }}
-
- graph.xAxis.format = graph.xAxis.formats.normal;
- graph.draw();
-}
-{% endblock %}
-
-{% block body %}
-
-{% call simple_utils.simple_run_page(tag, machine, run, compare_to,
- neighboring_runs) %}
-
-{{ utils.render_popup_begin('view_options', 'View Options', true) }}
-<form action="" method="get">
-<b>Show Median Absolute Deviation:</b>
-<input type="checkbox" name="show_mad" value="yes"><br>
-
-<b>Show Standard Deviation:</b>
-<input type="checkbox" name="show_stddev" value="yes"><br>
-
-<b>Show Linear Regression:</b>
-<input type="checkbox" name="show_linear_regression" value="yes"><br>
-
-{# Add all the hidden fields. #}
-{% for name,value in request.args.items() %}
- {% if name.startswith('test.') or name.startswith('pset.') %}
- <input type="hidden" name="{{name}}" value="{{value}}"><br>
- {% endif %}
-{% endfor %}
-
-<input type="submit" name="submit" value="Update">
-</form>
-{{ utils.render_popup_end() }}
-
-<h3>Graph</h3>
-<table>
-<tr>
-<td rowspan=2 valign="top">
- <canvas id="graph" width="600" height="400"></canvas>
-</td>
-<td valign="top">
-<table cellspacing=4 border=1>
-<tr><th colspan=2>Test</th></tr>
-{% for name,col in legend %}
- <tr><td bgcolor="{{ '%02x%02x%02x' % (
- 255*col[0], 255*col[1], 255*col[2]) }}"> </td>
- <td>{{name}}</td></tr>
-{% endfor %}
-</table>
-</td></tr>
-<tr><td align="right" valign="bottom">
-<font size="-2">
-Shift-Left Mouse: Pan<br>
-Alt/Meta-Left Mouse: Zoom<br>
-Wheel: Zoom (<i>Shift Slows</i>)<br>
-</font>
-</td></tr>
-</table>
-<p>
-<b>Plots</b>: {{ num_plots }}<br>
-<b>Num Points</b>: {{ num_points }}<br>
-
-<h2>Deltas</h2>
-{% for deltas in plot_deltas %}
- {% set (name,col) = legend[loop.index0] %}
-<h3>{{name}}</h3>
-<table>
-<tr>
- <th colspan=2>Revision</th>
- <th> </th>
- <th colspan=2>Value</th>
- <th></th>
- <th></th>
- <th colspan=2>MAD</th>
- <th colspan=2>Med - Min</th>
-<tr>
- <th>Current</th>
- <th>Previous</th>
- <th>Delta (%)</th>
- <th>Current</th>
- <th>Previous</th>
- <th># Revs</th>
- <th> </th>
- <th>Current</th>
- <th>Previous</th>
- <th>Current</th>
- <th>Previous</th>
-</tr>
-
-{% for (pct,(r0,t0,mad0,med0),(r1,t1,mad1,med1)) in deltas %}
-<tr>
- <td><a href="http://llvm.org/viewvc/llvm-project?view=rev&revision={{r1}}">{{r1}}</a></td>
- <td><a href="http://llvm.org/viewvc/llvm-project?view=rev&revision={{r0}}">{{r0}}</a></td>
- {{pct|aspctcell(delta=true)|safe}}
- <td>{{ "%.4f" % t1 }}</td><td>{{ "%.4f" % t0}}</td>
- <td>{{ r1 - r0 }}</td>
- <td> </td>
- <td>{{ "%.4f" % mad1 }}</td><td>{{ "%.4f" % mad0 }}</td>
- <td>{{ "%.4f" % (med1-t1) }}</td><td>{{ "%.4f" % (med0-t0) }}</td>
-</tr>
-{% endfor %}
-
-</table>
-{% endfor %}
-
-<h3>Revisions to Sample</h3>
-{% for rev in new_sample_list %}
- {{ rev }}
-{% endfor %}
-<p>
-<h3>Revisions to Resample</h3>
-{% for rev in resample_list|sort %}
- {{ rev }}
-{% endfor %}
-<p>
-
-{% endcall %}
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/simple_machine.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/simple_machine.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/simple_machine.html (original)
+++ lnt/trunk/lnt/server/ui/templates/simple_machine.html (removed)
@@ -1,82 +0,0 @@
-{% import "utils.html" as utils %}
-
-{% set db = request.get_db() %}
-{% set machine = db.getMachine(id) %}
-
-{% extends "layout.html" %}
-{% set components = [(tag, db_url_for("simple_overview", tag=tag))] %}
-{% block head %}
- <script src="{{ url_for('.static', filename='popup.js') }}"></script>
-{% endblock %}
-{% block title %}Machine: {{machine.name}}:{{machine.number}}{% endblock %}
-{% block body %}
-
-<table width="100%%" border=1>
- <tr>
- <td valign="top" width="200">
- <a href="../..">Homepage</a>
- <h4>Relatives:</h4>
- <ul>
-
-{# List all machines with this name. #}
-{% for m in db.machines(name=machine.name) %}
- <li><a href="{{ db_url_for('simple_machine', tag=tag, id=m.id)}}">{{
- m.name}}:{{m.number}}</a></li>
-{% endfor %}
- </ul>
- </td>
- <td valign="top">
- <table border=1>
- <tr>
- <td> <b>Nickname</b> </td>
- <td> {{machine.name}} </td>
- </tr>
- <tr>
- <td> <b>Machine ID</b> </td>
- <td> {{machine.id}} </td>
- </tr>
- </table>
-
-
-{{ utils.render_popup_begin('machine_info', 'Machine Info', true, 1) }}
- <table border=1>
-{% for key,item in machine.info|dictsort %}
- <tr>
- <td> <b>{{key}}</b> </td>
- <td>{{item.value}}</td>
- </tr>
-{% endfor %}
- </table>
-{{ utils.render_popup_end() }}
-
-<p>
-<table class="sortable" border=1>
-<thead>
- <tr>
- <th>Run Order</th>
- <th>Start Time</th>
- <th>End Time</th>
- <th> </th>
- </tr>
-</thead>
-{% for order,runs in associated_runs|sort|reverse %}
-{% for run in runs %}
- <tr>
-{% if loop.first %}
- <td rowspan="{{ runs|length }}" align=right>{{order}}</td>
-{% endif %}
- <td>{{ run.start_time }}</td>
- <td>{{ run.end_time }}s</td>
- <td><a href="{{db_url_for('simple_run', tag=tag, id=run.id)}}">
- View Results</a></td>
- </tr>
-{% endfor %}
-{% endfor %}
-</table>
-
-
- </td>
- </tr>
-</table>
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/simple_order_aggregate_report.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/simple_order_aggregate_report.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/simple_order_aggregate_report.html (original)
+++ lnt/trunk/lnt/server/ui/templates/simple_order_aggregate_report.html (removed)
@@ -1,77 +0,0 @@
-{% import "simple_utils.html" as simple_utils %}
-{% import "utils.html" as utils %}
-
-{% set db = request.get_db() %}
-
-{% extends "layout.html" %}
-{% set components = [(tag, db_url_for("simple_overview", tag=tag))] %}
-
-{% block title %}Order Aggregate Report{% endblock %}
-
-{% block head %}
- <link rel="stylesheet" type="text/css"
- href="/static/order_aggregate_ui.css">
- <script src="/static/jquery/1.5/jquery.js"></script>
- <script src="/static/flot/jquery.flot.js"></script>
- <script src="/static/order_aggregate_ui.js"></script>
-{% endblock %}
-{% block javascript %}
-var g = {};
-
-g.data_table = {{data_table|tojson|safe}};
-g.test_subsets = {{test_subsets|tojson|safe}};
-g.available_machines = {{available_machine_info|tojson|safe}};
-g.orders_to_aggregate = {{orders_to_aggregate|tojson|safe}};
-
-// Register initialization.
-window.onload = function() {
- new OrderAggregateReport("order_aggregate_report_ui", g).init();
-}
-{% endblock %}
-
-{% block body %}
-
-<div id="order_aggregate_report_ui"></div>
-
-{# Template code for dumping the data table, for use in debugging. #}
-{#
-
-<h1>Order Aggregate Data</h1>
-
-{% for subset_name,subset_table in data_table|dictsort %}
-<h2>{{ subset_name }}</h2>
-
-<table>
-<thead>
- <tr>
- <th>Test Name</th>
- <th>Machine</th>
-{% for order in orders_to_aggregate %}
- <th>{{ order }}</th>
-{% endfor %}
- </tr>
-</thead>
-
-{% set num_machines = available_machines|length %}
-{% for test_name,test_data in subset_table|dictsort %}
-{% for machine in available_machines %}
-{% set machine_idx = loop.index0 %}
-<tr>
-{% if loop.index0 == 0 %}
- <td rowspan="{{num_machines}}">{{ test_name }}</td>
-{% endif %}
- <td>{{ machine.name }}</td>
-{% for order in orders_to_aggregate %}
- <td>{{ test_data[loop.index0][machine_idx] }}</td>
-{% endfor %}
-</tr>
-
-{% endfor %}
-{% endfor %}
-</table>
-
-{% endfor %}
-
-#}
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/simple_overview.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/simple_overview.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/simple_overview.html (original)
+++ lnt/trunk/lnt/server/ui/templates/simple_overview.html (removed)
@@ -1,73 +0,0 @@
-{% set db = request.get_db() %}
-
-{% extends "layout.html" %}
-{% set components = [(tag, db_url_for("simple_overview", tag=tag))] %}
-{% block title %}Overview{% endblock %}
-{% block body %}
-
-{# Find recent runs. #}
-<center><h3>Submission Overview</h3></center>
-<table width="100%%">
- <tr>
- <td valign="top" width="50%">
- <center>
- <h3>Active Machines</h3>
- <table class="sortable" border=1>
- <thead>
- <tr>
- <th>Latest Submission</th>
- <th>Machine</th>
- <th>Results</th>
- </tr>
- </thead>
-
-{# Show the most active machines. #}
-{% for machine_name,r in active_machines|dictsort %}
- <tr>
- <td>{{r.start_time}}</td>
- <td align=left><a href="{{db_url_for('simple_machine',
- tag=tag, id=r.machine.id)}}">{{
- r.machine.name}}:{{r.machine.number}}</a></td>
- <td><a href="{{db_url_for('simple_run', tag=tag, id=r.id)}}">
- View Results</a></td>
- </tr>
-{% endfor %}
-
- </table>
- </center>
- </td>
- <td valign="top">
- <center>
- <h3>Recent Submissions</h3>
- <table class="sortable" border=1>
- <thead>
- <tr>
- <th>Run Order</th>
- <th>Start Time</th>
- <th>End Time</th>
- <th>Machine</th>
- <th>Results</th>
- </tr>
- </thead>
-
-{# Show the active submissions. #}
-{% for r,run_order in active_submissions %}
-{% set m = r.machine %}
- <tr>
- <td>{{run_order}}</td></td>
- <td>{{r.start_time}}</td>
- <td>{{r.end_time}}</td>
- <td align=left><a href="{{db_url_for('simple_machine',
- tag=tag, id=m.id)}}">{{
- m.name}}:{{m.number}}</a></td>
- <td><a href="{{db_url_for('simple_run', tag=tag, id=r.id)}}">
- View Results</a></td>
- </tr>
-{% endfor %}
- </table>
- </center>
- </td>
- </tr>
-</table>
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/simple_run.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/simple_run.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/simple_run.html (original)
+++ lnt/trunk/lnt/server/ui/templates/simple_run.html (removed)
@@ -1,264 +0,0 @@
-{% import "simple_utils.html" as simple_utils %}
-{% import "utils.html" as utils %}
-
-{% set db = request.get_db() %}
-{% set run = db.getRun(id) %}
-{% set machine = run.machine %}
-
-{% extends "layout.html" %}
-{% set components = [(tag, db_url_for("simple_overview", tag=tag)),
- ('machine', db_url_for("simple_machine",
- tag=tag, id=machine.id))] %}
-{% block head %}
- <script src="{{ url_for('.static', filename='popup.js') }}"></script>
- <script src="{{ url_for('.static', filename='sorttable.js') }}"></script>
- <script src="{{ url_for('.static', filename='View2D.js') }}"></script>
-{% endblock %}
-
-{% block title %}Run Results{% endblock %}
-
-{# Add JS to run the init_report function, if embedded. #}
-{% block onload %}init(){% endblock %}
-{% block javascript %}
-function init() {
- if (init_report) {
- init_report();
- }
-}
-{% endblock %}
-
-{% block body %}
-
-{% macro get_cell_value(cr) %}
-{% set test_status = cr.get_test_status() %}
-{% set value_status = cr.get_value_status() %}
-{% set run_cell_value = "-" if cr.current is none else "%.4f" % cr.current %}
-
-{% if options.show_previous %}
-{% set prev_cell_value = "-" if cr.previous is none else "%.4f" % cr.previous %}
- <td>{{prev_cell_value}}</td>
-{% endif %}
-
-{% set cell_color = none %}
-{% if test_status == runinfo.REGRESSED %}
- {% set cell_color = (233,128,128) %}
-{% elif test_status == runinfo.IMPROVED %}
- {% set cell_color = (143,223,95) %}
-{% elif test_status == runinfo.UNCHANGED_FAIL %}
- {% set cell_color = (255,195,67) %}
-{% endif %}
-
-{% if cell_color %}
- <td bgcolor="{{ '#%02x%02x%02x' % cell_color }}">{{
- run_cell_value}}</td>
-{% else %}
- <td>{{run_cell_value}}</td>
-{% endif %}
-
-{% if (options.show_all or
- value_status == runinfo.REGRESSED or
- value_status == runinfo.IMPROVED) %}
- {{ cr.pct_delta|aspctcell|safe }}
-{% else %}
- <td>-</td>
-{% endif %}
-
-{% if options.show_delta %}
- <td>{{ "-" if cr.delta is none else "%.4f" % cr.delta }}</td>
-{% endif %}
-{% if options.show_stddev %}
- <td>{{ "-" if cr.stddev is none else "%.4f" % cr.stddev }}</td>
-{% endif %}
-{% if options.show_mad %}
- <td>{{ "-" if cr.MAD is none else "%.4f" % cr.MAD }}</td>
-{% endif %}
-{% if options.show_all_samples %}
- <td>[
- {%- for v in cr.get_samples() -%}
- {{ ", " if not loop.first else "" }}
- {{ "%.4f" % v }}
- {%- endfor -%}]</td>
-{% endif %}
-
-{% if options.show_sample_counts %}
- <td>{{cr.get_samples()|length}}</td>
-{% endif %}
-
-{% endmacro %}
-
-{% call simple_utils.simple_run_page(tag, machine, run, compare_to,
- neighboring_runs) %}
-
-{{ utils.render_popup_begin('view_options', 'View Options', true) }}
-<form action="" method="get">
-<b>Show Delta:</b>
-<input type="checkbox" name="show_delta" value="yes" {{
- "checked" if options.show_delta else "" }}><br>
-
-<b>Show Previous Value:</b>
-<input type="checkbox" name="show_previous" value="yes" {{
- "checked" if options.show_previous else "" }}><br>
-
-<b>Show Standard Deviation:</b>
-<input type="checkbox" name="show_stddev" value="yes" {{
- "checked" if options.show_stddev else "" }}><br>
-
-<b>Show Median Absolute Deviation:</b>
-<input type="checkbox" name="show_mad" value="yes" {{
- "checked" if options.show_mad else "" }}><br>
-
-<b>Show All Values:</b>
-<input type="checkbox" name="show_all" value="yes" {{
- "checked" if options.show_all else "" }}><br>
-
-<b>Show All Samples:</b>
-<input type="checkbox" name="show_all_samples" value="yes" {{
- "checked" if options.show_all_samples else "" }}><br>
-
-<b>Show Sample Counts:</b>
-<input type="checkbox" name="show_sample_counts" value="yes" {{
- "checked" if options.show_sample_counts else "" }}><br>
-
-<b>Number of Comparison Runs:</b>
-<input type="text" name="num_comparison_runs" value="{{
- options.num_comparison_runs }}"><br>
-
-<b>Show Report Graphs:</b>
-<input type="checkbox" name="show_graphs" value="yes" {{
- "checked" if options.show_graphs else "" }}><br>
-
-<b>Show Data Table:</b>
-<input type="checkbox" name="show_data_table" value="yes" {{
- "checked" if options.show_data_table else "" }}><br>
-
-<b>Hide Report By Default:</b>
-<input type="checkbox" name="hide_report_by_default" value="yes" {{
- "checked" if options.hide_report_by_default else "" }}><br>
-
-<b>Test Filter (regexp):</b>
-<input type="text" name="test_filter" value="{{
- options.test_filter }}"><br>
-
-<input type="submit" name="submit" value="Update">
-</form>
-{{ utils.render_popup_end() }}
-
-{{ utils.render_popup_begin('text_report', 'Report (Text)', true) }}
-<pre>{{ text_report }}</pre>
-{{ utils.render_popup_end() }}
-
-{{ utils.render_popup_begin('html_report', 'Report (HTML)',
- options.hide_report_by_default) }}
-{{html_report|safe}}
-{{ utils.render_popup_end() }}
-
-<h3>Parameter Sets</h3>
-<table border=1>
- <tr>
- <th rowspan=2>Name</th>
- <th colspan={{ts_summary.parameter_sets|length}}>Parameters</th>
- </tr>
- <tr>
-{% for key in ts_summary.parameter_keys %}
- <th>{{key}}</th>
-{% endfor %}
- </tr>
-
-{% for pmap in ts_summary.parameter_maps %}
- <tr>
- <td>P{{loop.index0}}</td>
- {% for key in ts_summary.parameter_keys %}
- {% set item = pmap.get(key) %}
- <td>{{ "-" if item is none else item }}</td>
- {% endfor %}
- </tr>
-{% endfor %}
-</table>
-
-<h3>Tests</h3>
-
-{% set pset_cols = (
- 2 + options.show_previous + options.show_delta + options.show_stddev +
- options.show_mad + options.show_all_samples + options.show_sample_counts) %}
-
-<form method="GET" action="{{ db_url_for('simple_graph',
- tag=tag, id=id) }}">
-<table class="sortable" border=1>
-<thead>
- <tr>
- <th rowspan="1"></th>
- <th rowspan="1">Name</th>
-{% for key in ts_summary.parameter_sets %}
- <th colspan="{{pset_cols}}">P{{loop.index0}}</th>
-{% endfor %}
- </tr>
- <tr>
- <th></th>
- <th></th>
-{% for key in ts_summary.parameter_sets %}
- {% if options.show_previous %}
- <th>Prev</th>
- {% endif %}
- <th><input type="checkbox" name="pset.{{loop.index0}}"
- value="on" checked></th>
- <th>%</th>
- {% if options.show_delta %}
- <th>Δ</th>
- {% endif %}
- {% if options.show_stddev %}
- <th>σ</th>
- {% endif %}
- {% if options.show_mad %}
- <th>MAD</th>
- {% endif %}
- {% if options.show_all_samples %}
- <th>Samples</th>
- {% endif %}
- {% if options.show_sample_counts %}
- <th>N</th>
- {% endif %}
-{% endfor %}
- </tr>
-</thead>
-
-{% for name in test_names|sort %}
- <tr>
- <td><input type="checkbox" name="test.{{name}}"></td>
- <td>{{name}}</td>
- {% for pset in ts_summary.parameter_sets %}
- {% set cr = simple_run_info.get_run_comparison_result(
- run, run_status_kind, compare_to, compare_to_status_kind,
- name, pset, comparison_window) %}
- {{ get_cell_value(cr) }}
- {% endfor %}
- </tr>
-{% endfor %}
-</table>
-<input type="submit" value="Graph">
-</form>
-
-{% if options.show_data_table %}
-
-<h3>Test Data</h3>
-
-<pre>
-Name{% for key in ts_summary.parameter_sets
-%} P{{loop.index0}} P{{loop.index0}} P{{loop.index0}}{%
- endfor %}
--{% for key in ts_summary.parameter_sets
-%} Prev Value %{% endfor %}
-{% for name in test_names|sort %}
-{{name}}{%
-for pset in ts_summary.parameter_sets %}{%
- set cr = simple_run_info.get_run_comparison_result(
- run, run_status_kind, compare_to, compare_to_status_kind,
- name, pset, comparison_window)
-%} {{cr.previous}} {{cr.current}} {{cr.pct_delta}}{% endfor %}{%
-endfor %}
-
-</pre>
-{% endif %}
-
-{% endcall %}
-
-{% endblock %}
Removed: lnt/trunk/lnt/server/ui/templates/simple_utils.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/simple_utils.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/simple_utils.html (original)
+++ lnt/trunk/lnt/server/ui/templates/simple_utils.html (removed)
@@ -1,85 +0,0 @@
-{% import "utils.html" as utils %}
-
-{% macro simple_run_page(tag, machine, run, compare_to,
- neighboring_runs) %}
-
-<center>
- <table>
- <tr>
- <td align=right>Machine:</td>
- <td>{{machine.name}}:{{machine.number}}</td>
- </tr>
- <tr>
- <td align=right>Run:</td>
- <td>{{run.start_time}} ({{
- run.info['run_order'].value}})</td>
- </tr>
-{% if compare_to %}
- <tr>
- <td align=right>Compare To:</td>
- <td>{{compare_to.start_time}} ({{
- compare_to.info['run_order'].value}})</td>
- </tr>
-{% endif %}
- </table>
-</center>
-<p>
-
-<table width="100%%" border=1>
- <tr>
- <td valign="top" width="200">
- <a href="..">Homepage</a>
- <h4>Machine:</h4>
- <a href="{{ db_url_for('simple_machine', tag=tag, id=machine.id) }}">{{
- machine.name}}:{{machine.number}}</a>
- <h4>Runs:</h4>
- <ul>
-
-{# Show a small number of neighboring runs. #}
-{% for r in neighboring_runs %}
- <li>{{ "<h3>"|safe if r.id == run.id else "" }}
- <a href="{{db_url_for('simple_run', tag=tag, id=r.id)}}">{{
- r.start_time}}</a>{{
- "</h3>"|safe if r.id == run.id else "" }}
-{% endfor %}
- </ul>
- </td>
- <td valign="top">
- <table border=1>
- <tr>
- <td> <b>Nickname</b> </td>
- <td> {{machine.name}} </td>
- </tr>
- <tr>
- <td> <b>Machine ID</b> </td>
- <td> {{machine.id}} </td>
- </tr>
- </table>
-{{ utils.render_popup_begin('machine_info', 'Machine Info', true) }}
- <table border=1>
-{% for key,item in machine.info|dictsort(true) %}
- <tr>
- <td> <b>{{key}}</b> </td>
- <td>{{item.value}}</td>
- </tr>
-{% endfor %}
- </table>
-{{ utils.render_popup_end() }}
-
-{{ utils.render_popup_begin('run_info', 'Run Info', true) }}
- <table border=1>
-{% for key,item in run.info|dictsort(true) %}
- <tr>
- <td> <b>{{key}}</b> </td>
- <td>{{item.value.replace("\n","<br>")|safe}}</td>
- </tr>
-{% endfor %}
- </table>
-{{ utils.render_popup_end() }}
-{{ caller() }}
-
- </td>
- </tr>
-</table>
-
-{% endmacro %}
Removed: lnt/trunk/lnt/server/ui/templates/test.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/test.html?rev=161333&view=auto
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/test.html (original)
+++ lnt/trunk/lnt/server/ui/templates/test.html (removed)
@@ -1,42 +0,0 @@
-{% set db = request.get_db() %}
-{% set test = db.getTest(id) %}
-
-{% extends "layout.html" %}
-{% set components = [("browse", db_url_for("browse"))] %}
-{% block title %}Test: {{test.name}}{% endblock %}
-{% block body %}
-
-{# Show the test info dictionary. #}
-<h3>Test Info</h3>
-<table border=1 cellborder=1>
- <tr>
- <th>Key</th>
- <th>Value</th>
- </tr>
- </thead>
-{% for key,value in test.info|dictsort %}
- <tr>
- <td>{{key}}</td>
- <td>{{value}}</td>
- </tr>
-{% endfor %}
-</table>
-
-{# List samples. #}
-<h3>Associated Samples</h3>
-<table class="sortable" border=1 cellborder=1>
- <thead>
- <tr>
- <th>Run ID</th>
- <th>Value</th>
- </tr>
- </thead>
-{% for s in db.samples(test=test) %}
- <tr>
- <td><a href="{{db_url_for('run', id=s.run_id)}}">{{s.run_id}}</a></td>
- <td>{{s.value}}</td>
- </tr>
-{% endfor %}
-</table>
-
-{% endblock %}
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=161334&r1=161333&r2=161334&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Mon Aug 6 15:02:44 2012
@@ -20,6 +20,7 @@
from lnt.db import perfdb
from lnt.server.ui.globals import db_url_for, v4_url_for
import lnt.server.reporting.analysis
+from lnt.db import runinfo
from lnt.server.ui.decorators import frontend, db_route, v4_route
###
@@ -57,10 +58,6 @@
###
# Database Actions
- at db_route('/browse')
-def browse():
- return render_template("browse.html")
-
@db_route('/submitRun', only_v3=False, methods=('GET', 'POST'))
def submit_run():
if request.method == 'POST':
@@ -119,525 +116,6 @@
return render_template("submit_run.html")
###
-# Generic Database Views
-
- at db_route("/machines/<id>/")
-def machine(id):
- return render_template("machine.html", id=id)
-
- at db_route("/runs/<id>/")
-def run(id):
- return render_template("run.html", id=id)
-
- at db_route("/tests/<id>/")
-def test(id):
- return render_template("test.html", id=id)
-
-###
-# Simple LNT Schema Viewer
-
-from lnt.db.perfdb import Machine, Run, RunInfo, Sample
-from lnt.db import runinfo
-from lnt.db import perfdbsummary
-from lnt.util import NTEmailReport
-
- at db_route("/simple/<tag>/", only_v3=False)
-def simple_overview(tag):
- # If this is a v0.4 database, redirect.
- if g.db_info.db_version != '0.3':
- return redirect(db_url_for("v4_overview", testsuite_name=tag))
-
- db = request.get_db()
-
- # Get the most recent runs in this tag, we just arbitrarily limit to looking
- # at the last 100 submission.
- recent_runs = db.query(Run).\
- join(RunInfo).\
- order_by(Run.start_time.desc()).\
- filter(RunInfo.key == "tag").\
- filter(RunInfo.value == tag).limit(100)
- recent_runs = list(recent_runs)
-
- # Compute the active machine list.
- active_machines = dict((run.machine.name, run)
- for run in recent_runs[::-1])
-
- # Compute the active submission list.
- N = 30
- active_run_orders = dict(
- db.query(RunInfo.run_id, RunInfo.value).\
- filter(RunInfo.key == "run_order").\
- filter(RunInfo.run_id.in_(s.id for s in recent_runs[:N])))
- active_submissions = [(r, active_run_orders.get(r.id))
- for r in recent_runs[:N]]
-
- return render_template("simple_overview.html", tag=tag,
- active_machines=active_machines,
- active_submissions=active_submissions)
-
- at db_route("/simple/<tag>/machines/<int:id>")
-def simple_machine(tag, id):
- db = request.get_db()
-
- # Get the run summary.
- run_summary = perfdbsummary.SimpleSuiteRunSummary.get_summary(db, tag)
-
- # Compute the list of associated runs, grouped by order.
- from lnt.server.ui import util
- grouped_runs = util.multidict(
- (run_summary.get_run_order(run_id), run_id)
- for run_id in run_summary.get_runs_on_machine(id))
-
- associated_runs = [(order, [db.getRun(run_id)
- for run_id in runs])
- for order,runs in grouped_runs.items()]
-
- return render_template("simple_machine.html", tag=tag, id=id,
- associated_runs=associated_runs)
-
-def get_simple_run_info(tag, id):
- db = request.get_db()
-
- run = db.getRun(id)
-
- # Get the run summary.
- run_summary = perfdbsummary.SimpleSuiteRunSummary.get_summary(db, tag)
-
- # Get the comparison run.
- compare_to = None
- compare_to_id = request.args.get('compare')
- if compare_to_id is not None:
- try:
- compare_to = db.getRun(int(compare_to_id))
- except:
- pass
- if compare_to is None:
- prev_id = run_summary.get_previous_run_on_machine(run.id)
- if prev_id is not None:
- compare_to = db.getRun(prev_id)
-
- return db, run, run_summary, compare_to
-
- at db_route("/simple/<tag>/<id>/report")
-def simple_report(tag, id):
- db, run, run_summary, compare_to = get_simple_run_info(tag, id)
-
- show_graphs = bool(request.args.get('show_graphs'))
- _, _, html_report = NTEmailReport.getSimpleReport(
- None, db, run, url_for('index', db_name=g.db_name),
- True, True, show_graphs = show_graphs)
-
- return make_response(html_report)
-
- at db_route("/simple/<tag>/<id>/text_report")
-def simple_text_report(tag, id):
- db, run, run_summary, compare_to = get_simple_run_info(tag, id)
-
- _, text_report, _ = NTEmailReport.getSimpleReport(
- None, db, run, url_for('index', db_name=g.db_name),
- True, True)
-
- response = make_response(text_report)
- response.mimetype = "text/plain"
- return response
-
- at db_route("/simple/<tag>/<int:id>/", only_v3=False)
-def simple_run(tag, id):
- # If this is a v0.4 database, redirect.
- if g.db_info.db_version != '0.3':
- # Attempt to find a V4 run which declares that it matches this simple
- # run ID.
-
- # Get the expected test suite.
- db = request.get_db()
- ts = db.testsuite[tag]
-
- # Look for a matched run.
- matched_run = ts.query(ts.Run).\
- filter(ts.Run.simple_run_id == id).\
- first()
-
- # If we found one, redirect to it's report.
- if matched_run is not None:
- return redirect(db_url_for("v4_run", testsuite_name=tag,
- id=matched_run.id))
-
- # Otherwise, report an error.
- return render_template("error.html", message="""\
-Unable to find a v0.4 run for this ID. Please use the native v0.4 URL interface
-(instead of the /simple/... URL schema).""")
-
- db, run, run_summary, compare_to = get_simple_run_info(tag, id)
-
- # Get additional summaries.
- ts_summary = perfdbsummary.get_simple_suite_summary(db, tag)
- sri = runinfo.SimpleRunInfo(db, ts_summary)
-
- # Get the neighboring runs.
- cur_id = run.id
- for i in range(3):
- next_id = run_summary.get_next_run_on_machine(cur_id)
- if not next_id:
- break
- cur_id = next_id
- neighboring_runs = []
- for i in range(6):
- neighboring_runs.append(db.getRun(cur_id))
- cur_id = run_summary.get_previous_run_on_machine(cur_id)
- if cur_id is None:
- break
-
- # Parse the view options.
- options = {}
- options['show_delta'] = bool(request.args.get('show_delta'))
- options['show_previous'] = bool(request.args.get('show_previous'))
- options['show_stddev'] = bool(request.args.get('show_stddev'))
- options['show_mad'] = bool(request.args.get('show_mad'))
- options['show_all'] = bool(request.args.get('show_all'))
- options['show_all_samples'] = bool(request.args.get('show_all_samples'))
- options['show_sample_counts'] = bool(request.args.get('show_sample_counts'))
- options['show_graphs'] = show_graphs = bool(request.args.get('show_graphs'))
- 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['test_filter'] = test_filter_str = request.args.get(
- 'test_filter', '')
- if test_filter_str:
- test_filter_re = re.compile(test_filter_str)
- else:
- test_filter_re = None
-
- _, text_report, html_report = NTEmailReport.getSimpleReport(
- None, db, run, url_for('index', db_name=g.db_name),
- True, True, only_html_body = True, show_graphs = show_graphs,
- num_comparison_runs = num_comparison_runs)
-
- # Get the test status style used in each run.
- run_status_kind = run_summary.get_run_status_kind(db, run.id)
- if compare_to:
- compare_to_status_kind = run_summary.get_run_status_kind(
- db, compare_to.id)
- else:
- compare_to_status_kind = None
-
- # Get the list of tests we are interest in.
- interesting_runs = [run.id]
- if compare_to:
- interesting_runs.append(compare_to.id)
- test_names = ts_summary.get_test_names_in_runs(db, interesting_runs)
-
- # Filter the list of tests, if requested.
- if test_filter_re:
- test_names = [test
- for test in test_names
- if test_filter_re.search(test)]
-
- # Gather the runs to use for statistical data, if enabled.
- cur_id = run.id
- comparison_window = []
- for i in range(num_comparison_runs):
- cur_id = run_summary.get_previous_run_on_machine(cur_id)
- if not cur_id:
- break
- comparison_window.append(cur_id)
-
- return render_template("simple_run.html", tag=tag, id=id,
- compare_to=compare_to,
- compare_to_status_kind=compare_to_status_kind,
- run_summary=run_summary, ts_summary=ts_summary,
- simple_run_info=sri, test_names=test_names,
- neighboring_runs=neighboring_runs,
- text_report=text_report, html_report=html_report,
- options=options, runinfo=runinfo,
- comparison_window=comparison_window,
- run_status_kind=run_status_kind)
-
- at db_route("/simple/<tag>/<int:id>/graph", only_v3=False)
-def simple_graph(tag, id):
- from lnt.server.ui import graphutil
- from lnt.server.ui import util
- # If this is a v0.4 database, redirect.
- if g.db_info.db_version != '0.3':
- # Attempt to find a V4 run which declares that it matches this simple
- # run ID.
-
- # Get the expected test suite.
- db = request.get_db()
- ts = db.testsuite[tag]
-
- # Look for a matched run.
- matched_run = ts.query(ts.Run).\
- filter(ts.Run.simple_run_id == id).\
- first()
-
- # If we found one, redirect to it's report.
- if matched_run is not None:
- # We need to translate all of the graph parameters.
- v4_graph_args = {}
-
- for name,value in request.args.items():
- if name.startswith("pset."):
- # We don't use psets anymore, just ignore.
- continue
- if name.startswith("test."):
- # Rewrite test arguments to point at the correct new test.
- #
- # The old style encoded tests to print as:
- # test.<name>=on
- # where the name is the mangled form.
- if value != "on":
- continue
-
- # Strip the prefix.
- test_name = name[5:]
-
- # Determine the sample field.
- for sample_index,item in enumerate(ts.sample_fields):
- if test_name.endswith(item.info_key):
- test_name = test_name[:-len(item.info_key)]
- break
- else:
- # We didn't recognize this test parameter. Just bail.
- return render_template("error.html", message="""\
-Unexpected query argument %r""" % (name,))
-
- # Find the test id for that test name.
- test = ts.query(ts.Test).\
- filter(ts.Test.name == test_name).first()
- if test is None:
- return render_template("error.html", message="""\
-Unknown test %r""" % (test_name,))
-
- # Add the query argument in the manner that v4_graph
- # expects.
- v4_graph_args["test.%d" % test.id] = sample_index
- else:
- # Otherwise, assume this is a view parameter and we can
- # forward as is.
- v4_graph_args[name] = value
-
- return redirect(db_url_for("v4_graph", testsuite_name=tag,
- id=matched_run.id, **v4_graph_args))
-
- # Otherwise, report an error.
- return render_template("error.html", message="""\
-Unable to find a v0.4 run for this ID. Please use the native v0.4 URL interface
-(instead of the /simple/... URL schema).""")
-
- db, run, run_summary, compare_to = get_simple_run_info(tag, id)
-
- # Get additional summaries.
- ts_summary = perfdbsummary.get_simple_suite_summary(db, tag)
-
- # Get the neighboring runs.
- cur_id = run.id
- for i in range(3):
- next_id = run_summary.get_next_run_on_machine(cur_id)
- if not next_id:
- break
- cur_id = next_id
- neighboring_runs = []
- for i in range(6):
- neighboring_runs.append(db.getRun(cur_id))
- cur_id = run_summary.get_previous_run_on_machine(cur_id)
- if cur_id is None:
- break
-
- # Parse the view options.
- options = {}
- show_mad = bool(request.args.get('show_mad', True))
- show_stddev = bool(request.args.get('show_stddev'))
- show_linear_regression = bool(
- request.args.get('show_linear_regression', True))
-
- # Load the graph parameters.
- graph_tests = []
- graph_psets = []
- for name,value in request.args.items():
- if name.startswith(str('test.')):
- graph_tests.append(name[5:])
- elif name.startswith(str('pset.')):
- graph_psets.append(ts_summary.parameter_sets[int(name[5:])])
-
- # Get the test ids we want data for.
- test_ids = [ts_summary.test_id_map[(name,pset)]
- for name in graph_tests
- for pset in graph_psets]
-
- # Build the graph data
- pset_id_map = dict([(pset,i)
- for i,pset in enumerate(ts_summary.parameter_sets)])
- legend = []
- num_points = 0
- plot_points = []
- plots = ""
- plots_iter = graphutil.get_test_plots(
- db, run.machine, test_ids, run_summary, ts_summary,
- show_mad_error = show_mad, show_stddev = show_stddev,
- show_linear_regression = show_linear_regression, show_points = True)
- for test_id, plot_js, col, points, ext_points in plots_iter:
- test = db.getTest(test_id)
- name = test.name
- pset = test.get_parameter_set()
-
- num_points += len(points)
- legend.append(("%s : P%d" % (name, pset_id_map[pset]), tuple(col)))
- plots += plot_js
- plot_points.append(ext_points)
-
- # Build the sample info.
- resample_list = set()
- new_sample_list = []
- plot_deltas = []
- for (name,col),points in zip(legend,plot_points):
- points.sort()
- deltas = [(util.safediv(p1[1], p0[1]), p0, p1)
- for p0,p1 in util.pairs(points)]
- deltas.sort()
- deltas.reverse()
- plot_deltas.append(deltas[:20])
- for (pct,(r0,t0,mad0,med0),(r1,t1,mad1,med1)) in deltas[:20]:
- # Find the best next revision to sample, unless we have
- # sampled to the limit. To conserve resources, we try to
- # align to the largest "nice" revision boundary that we can,
- # so that we tend to sample the same revisions, even as we
- # drill down.
- assert r0 < r1 and r0 != r1
- if r0 + 1 != r1:
- for align in [scale * boundary
- for scale in (100000,10000,1000,100,10,1)
- for boundary in (5, 1)]:
- r = r0 + 1 + (r1 - r0)//2
- r = (r // align) * align
- if r0 < r < r1:
- new_sample_list.append(r)
- break
-
- resample_list.add(r0)
- resample_list.add(r1)
-
- return render_template("simple_graph.html", tag=tag, id=id,
- compare_to=compare_to,
- neighboring_runs=neighboring_runs,
- run_summary=run_summary, ts_summary=ts_summary,
- graph_plots=plots, legend=legend,
- num_plots=len(test_ids), num_points=num_points,
- new_sample_list=new_sample_list,
- resample_list=resample_list,
- plot_deltas=plot_deltas)
-
- at db_route("/simple/<tag>/order_aggregate_report")
-def simple_order_aggregate_report(tag):
- from lnt.server.ui import util
-
- db = request.get_db()
-
- # Get the run summary.
- run_summary = perfdbsummary.SimpleSuiteRunSummary.get_summary(db, tag)
- # Load the test suite summary.
- ts_summary = perfdbsummary.get_simple_suite_summary(db, tag)
- # Get the run pass/fail information.
- sri = runinfo.SimpleRunInfo(db, ts_summary)
-
- # Get this list of orders we are aggregating over.
- orders_to_aggregate = request.args.get('orders', '')
- orders_to_aggregate = orders_to_aggregate.split(',')
-
- # Collect the runs, aggregated by order and machine.
- runs_to_summarize = []
- runs_by_machine_and_order = util.multidict()
- available_machine_ids = set()
- for order in orders_to_aggregate:
- for id in run_summary.runs_by_order["%7s" % order]:
- r = db.getRun(id)
- runs_to_summarize.append(r)
- available_machine_ids.add(r.machine_id)
- runs_by_machine_and_order[(r.machine_id, order)] = r
- available_machine_ids = list(available_machine_ids)
- available_machine_ids.sort()
- available_machines = [db.getMachine(id)
- for id in available_machine_ids]
-
- # We currently only compare the null pset.
- pset = ()
-
- # Get the list of tests we are interested in.
- test_names = ts_summary.get_test_names_in_runs(db, (
- r.id for r in runs_to_summarize))
-
- # Create test subsets, by name.
- test_subsets = util.multidict()
- for test_name in test_names:
- if '.' in test_name:
- subset = test_name.rsplit('.', 1)[1]
- else:
- subset = test_name, ''
- test_subsets[subset] = test_name
-
- # Convert subset names to pretty form.
- def convert((subset, tests)):
- subset_name = { "compile" : "Compile Time",
- "exec" : "Execution Time" }.get(subset, subset)
- return (subset_name, tests)
- test_subsets = dict(convert(item) for item in test_subsets.items())
-
- # Batch load all the samples for all the runs we are interested in.
- start_time = time.time()
- all_samples = db.session.query(Sample.run_id, Sample.test_id,
- Sample.value).\
- filter(Sample.run_id.in_(
- r.id for r in runs_to_summarize))
- all_samples = list(all_samples)
-
- # Aggregate samples for easy lookup.
- aggregate_samples = util.multidict()
- for run_id, test_id, value in all_samples:
- aggregate_samples[(run_id, test_id)] = value
-
- # Create the data table as:
- # data_table[subset_name][test_name][order index][machine index] = (
- # status samples, samples)
- def get_test_samples(machine_id, test_name, order):
- status_name = test_name + '.status'
- status_test_id = ts_summary.test_id_map.get(
- (status_name, pset))
- test_id = ts_summary.test_id_map.get(
- (test_name, pset))
-
- status_samples = []
- samples = []
- for run in runs_by_machine_and_order.get((machine_id,order), []):
- status_samples.extend(aggregate_samples.get(
- (run.id, status_test_id), []))
- samples.extend(aggregate_samples.get(
- (run.id, test_id), []))
-
- # For now, return simplified sample set. We can return all the data if
- # we find a use for it.
- if status_samples or not samples:
- return None
- return min(samples)
- data_table = {}
- for subset_name,tests_in_subset in test_subsets.items():
- data_table[subset_name] = subset_table = {}
- for test_name in tests_in_subset:
- subset_table[test_name] = test_data = [
- [get_test_samples(id, test_name, order)
- for id in available_machine_ids]
- for order in orders_to_aggregate]
-
- # Create some other data tables of serializable info.
- available_machine_info = [(m.id, m.name)
- for m in available_machines]
-
- return render_template("simple_order_aggregate_report.html", **locals())
-
-###
# V4 Schema Viewer
@v4_route("/")
@@ -773,6 +251,35 @@
response.mimetype = "text/plain"
return response
+# Compatilibity route for old run pages.
+ at db_route("/simple/<tag>/<int:id>/", only_v3=False)
+def simple_run(tag, id):
+ # Attempt to find a V4 run which declares that it matches this simple run
+ # ID. We do this so we can preserve some URL compatibility for old
+ # databases.
+ if g.db_info.db_version != '0.4':
+ return render_template("error.html", message="""\
+Invalid URL for version %r database.""" % (g.db_info.db_version,))
+
+ # Get the expected test suite.
+ db = request.get_db()
+ ts = db.testsuite[tag]
+
+ # Look for a matched run.
+ matched_run = ts.query(ts.Run).\
+ filter(ts.Run.simple_run_id == id).\
+ first()
+
+ # If we found one, redirect to it's report.
+ if matched_run is not None:
+ return redirect(db_url_for("v4_run", testsuite_name=tag,
+ id=matched_run.id))
+
+ # Otherwise, report an error.
+ return render_template("error.html", message="""\
+Unable to find a v0.4 run for this ID. Please use the native v0.4 URL interface
+(instead of the /simple/... URL schema).""")
+
@v4_route("/<int:id>")
def v4_run(id):
info = V4RequestInfo(id)
More information about the llvm-commits
mailing list