Skip to content

Commit

Permalink
Fix template to support optional criteria
Browse files Browse the repository at this point in the history
  • Loading branch information
smarr committed May 6, 2023
1 parent fe19967 commit 851bc8c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions src/views/compare/stats-row-across-versions.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
%}<td class="stats-samples">{%= s.total.samples %}</td>
<td><span class="stats-median" title="median">{%= f.r2(s.total.median) %}</span></td>
<td><span class="stats-change" title="change over median run time">{%= f.per(s.total.change_m) %}</span></td>
<td><span class="stats-median" title="median">{%= f.r0(s.gcTime.median) %}</span></td>
{% if (s.gcTime) {
%}<td><span class="stats-median" title="median">{%= f.r0(s.gcTime.median) %}</span></td>
<td><span class="stats-gc-change" title="change over median GC time">{%= f.per(s.gcTime.change_m) %}</span></td>
<td><span class="stats-median" title="median">{%= f.asHumanMem(s.allocated.median) %}</span></td>
<td><span class="stats-alloc-change" title="change over median allocated memory">{%= f.per(s.allocated.change_m) %}</span></td>
{% }
if (s.allocated) {
%}<td><span class="stats-median" title="median">{%= f.asHumanMem(s.allocated.median) %}</span></td>
<td><span class="stats-alloc-change" title="change over median allocated memory">{%= f.per(s.allocated.change_m) %}</span></td>{%
} %}
4 changes: 2 additions & 2 deletions src/views/compare/stats-tbl-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
<th scope="col" title="Number of Samples">#M</th>
<th scope="col">median time<br>in {%= it.criteria.total.unit %}</th>
<th scope="col">time diff %</th>
{% if (it.criteria['GC time'].unit !== null) { %}
{% if (it.criteria['GC time']) { %}
<th scope="col">median GC<br>time in {%= it.criteria['GC time'].unit %}</th>
<th scope="col">GC diff %</th>
{% }
if (it.criteria.Allocated.unit !== null) { %}
if (it.criteria.Allocated) { %}
<th scope="col">median <br>allocated {%= it.criteria.Allocated.unit %}</th>
<th scope="col">Alloc diff %</th>
{% } %}
Expand Down

0 comments on commit 851bc8c

Please sign in to comment.