Skip to content

Commit

Permalink
Better display of overview table when no baseline is present
Browse files Browse the repository at this point in the history
  • Loading branch information
tobami committed Apr 6, 2010
1 parent 2557cb7 commit dd5bfda
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions speedcenter/codespeed/views.py
Expand Up @@ -15,9 +15,9 @@ def getbaselineexecutables():
for entry in settings.baselinelist:
executable = Executable.objects.get(id=entry['executable'])
rev = Revision.objects.filter(
commitid=entry['revision'], project=executable.project
commitid=str(entry['revision']), project=executable.project
)
if len(rev) > 1:
if len(rev) > 0:
rev = rev[0]
else:
raise Revision.DoesNotExist
Expand All @@ -26,7 +26,7 @@ def getbaselineexecutables():
#shortname += " " + executable.coptions
name = executable.name + " " + executable.coptions
if rev.tag: name += " " + rev.tag
else: name += " " + str(rev.commitid)
else: name += " " + rev.commitid
baseline.append({
'executable': executable.id,
'name': name,
Expand Down
2 changes: 1 addition & 1 deletion speedcenter/media/css/main.css
Expand Up @@ -204,7 +204,7 @@ table.tablesorter {
border: 1px solid #CDCDCD;
}

table#results thead tr th { padding-right: 9px; }
table#results thead tr th { padding-right: 10px; }
table#results thead tr th.w { width: 6em; }
table#results thead tr th.bar {
background-image: url(/media/images/gridline_units.png);
Expand Down
6 changes: 3 additions & 3 deletions speedcenter/templates/codespeed/overview_table.html
@@ -1,15 +1,15 @@
<table id="results" class="tablesorter">
<thead>
<tr>
<th class="w">Benchmark</th><th class="w">Time (s)</th><th class="w">Current change</th><th class="w">Trend ({{ trendconfig }})</th>{% if baselineflag %}<th class="w" title="Compared to {{ baseexecutable.name }} {{ baserevision }}">Times {{ baseexecutable.shortname }}</th><th class="bar" title="Compared to {{ baseexecutable.name }} in log 2 scale"><div style="float:left;font-size:smaller;">slower</div><div style="float:left;margin-left:48px;">(log<sub>2</sub> scale)</div><div style="float:left;margin-left:60px;font-size:smaller;">faster</div></th>{% endif %}
<th class="w">Benchmark</th><th class="w">Time (s)</th><th class="w">Current change</th><th class="w">Trend ({{ trendconfig }})</th><th class="w" title="Compared to {{ baseexecutable.name }} {{ baserevision }}">Times {{ baseexecutable.shortname }}</th><th class="bar" {% if not baselineflag %}style="visibility:hidden; "{% endif %}title="Compared to {{ baseexecutable.name }} in log 2 scale"><div style="float:left;font-size:smaller;">slower</div><div style="float:left;margin-left:48px;">(log<sub>2</sub> scale)</div><div style="float:left;margin-left:60px;font-size:smaller;">faster</div></th>
</tr>
</thead>
<tfoot>
<tr><td class="text" title="Arithmetic mean">Average</td><td></td><td>{{ totals.change|floatformat:2 }}%</td><td>{{ totals.trend|floatformat:2 }}%</td>{% if baselineflag %}<td></td><td></td>{% endif %}</tr>
<tr><td class="text" title="Arithmetic mean">Average</td><td></td><td>{{ totals.change|floatformat:2 }}%</td><td>{{ totals.trend|floatformat:2 }}%</td><td></td><td{% if not baselineflag %} style="visibility:hidden;"{% endif %}></td></tr>
</tfoot>
<tbody>
{% for row in table_list %} <tr>
<td class="text"{% ifnotequal row.bench_description "" %} title="{{ row.bench_description }}"{% endifnotequal %}>{{ row.benchmark }}</td><td>{{ row.result|floatformat:4 }}</td><td>{{ row.change|floatformat:2 }}%</td><td>{% ifequal row.trend "-" %}-{% endifequal %}{% ifnotequal row.trend "-" %}{{ row.trend|floatformat:2 }}%{% endifnotequal %}</td>{% if baselineflag %}<td>{{ row.relative|floatformat:2 }}</td><td class="bar"><span>-</span></td>{% endif %}
<td class="text"{% ifnotequal row.bench_description "" %} title="{{ row.bench_description }}"{% endifnotequal %}>{{ row.benchmark }}</td><td>{{ row.result|floatformat:4 }}</td><td>{{ row.change|floatformat:2 }}%</td><td>{% ifequal row.trend "-" %}-{% endifequal %}{% ifnotequal row.trend "-" %}{{ row.trend|floatformat:2 }}%{% endifnotequal %}</td><td>{{ row.relative|floatformat:2 }}</td><td class="bar"{% if not baselineflag %} style="visibility:hidden;"{% endif %}><span>-</span></td>
</tr>{% endfor %}
</tbody>
</table>

0 comments on commit dd5bfda

Please sign in to comment.