* Render durations nicely.

This commit is contained in:
Eelco Dolstra 2009-03-13 16:04:49 +00:00
parent 107a0faa51
commit 2ece4d9f15
2 changed files with 13 additions and 5 deletions

View file

@ -154,7 +154,7 @@
[% IF build.resultInfo.iscachedbuild %]
<em>(cached build)</em>
[% ELSE %]
[% build.resultInfo.stoptime - build.resultInfo.starttime %]s
[% INCLUDE renderDuration duration = build.resultInfo.stoptime - build.resultInfo.starttime %]
[% END %]
</td>
</tr>
@ -227,12 +227,12 @@
</td>
<td>
[% IF step.busy == 0 %]
[% step.stoptime - step.starttime %]s
[% INCLUDE renderDuration duration = step.stoptime - step.starttime %]
[% ELSE %]
[% IF build.finished %]
[% build.resultInfo.stoptime - step.starttime %]s
[% INCLUDE renderDuration duration = build.resultInfo.stoptime - step.starttime %]
[% ELSE %]
[% curTime - step.starttime %]s
[% INCLUDE renderDuration duration = curTime - step.starttime %]
[% END %]
[% END %]
</td>

View file

@ -44,6 +44,14 @@
[% END %]
[% BLOCK renderDuration -%]
[% IF duration >= 24 * 60 * 60 %][% duration div (24 * 60 * 60) %]d[% END %]
[% IF duration >= 60 * 60 %][% duration div (60 * 60) % 24 %]h[% END %]
[% IF duration >= 60 %][% duration div 60 % 60 %]m[% END %]
[% duration % 60 %]s
[% END %]
[% BLOCK renderBuildList %]
<table class="buildList tablesorter">
<thead>
@ -116,7 +124,7 @@
</tr>
<tr>
<th>Total build time:</th>
<td>[% totalBuildTime %]s</td>
<td>[% INCLUDE renderDuration duration = totalBuildTime %]</td>
</tr>
<tr>
<th>Scheduled builds:</th>