IE3SRMWZ4YT6EYKAOG2HH54MXG5TYYBW7OEBHNYJUGW7KILFXX2AC
S66BOMVUACAUDSGSDWP7ZIXVMZSQHWXOZYVTB7ILUCWZ7DDFAKVAC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
L2E6EVE2RVFVDCUNRJ4CZYSQNS2DZUA5DTBETHBDUQUV2KQQRAOQC
LQNBKF3DKVYK3NPDGK7OLOTIWIF4HR3EKLRYNLZJB4G3NMIVBCEAC
PBFZEQLZXMOBQIWL5WQWH7D62XG6M7ROEEAH6PWAKKKOM3W5I3RQC
JLDUSNUOOQNL63BOPXIWZOWFRQ5X35RWG33PJB3J3KMR6QR7TN7QC
IK53RV4VGOHLCZGQCCIKPB45M3C7M7YMNBOJFBGZJ4LWIZNU4QNQC
H7CNGK4OJNRYZQGPLBGR72DULLEPFQ5UISF5J24D7IMA7SYW5LGQC
TQKGQ5R36VOLLJ3SR2WWIQ6VSN245N3QG4JHI2ZCP5T6RXN3PJWAC
WHAFVCEIHCWHKY2UVRGRQORERUAK6SZJI7ZENA367ZX4EXDIQMDQC
BVOPAMLSAU4UTV3DUX53OYDMXP2SETAQVUKAYE2OTCVVN4RD7LLQC
7YBYT2LQML2PKEO6UO4444AGSASS664UCDXW2YO3ALB7THQHCEBQC
W6DC6K4INJQOJYR553ISCKZV7YIOGHEM3FZQPOLAPSZQ3KSJDMRQC
2AUODJBTW2UJ47UB3SREZ7O7UTTJDQ4AGUQMPZAI4F3Y6BUF6LUQC
sub getBuildStats {
my ($c, $builds) = @_;
$c->stash->{finishedBuilds} = $builds->search({finished => 1}) || 0;
$c->stash->{succeededBuilds} = $builds->search(
{finished => 1, buildStatus => 0},
{join => 'resultInfo'}) || 0;
$c->stash->{scheduledBuilds} = $builds->search({finished => 0}) || 0;
$c->stash->{busyBuilds} = $builds->search(
{finished => 0, busy => 1},
{join => 'schedulingInfo'}) || 0;
$c->stash->{totalBuildTime} = $builds->search({},
{join => 'resultInfo', select => {sum => 'stoptime - starttime'}, as => ['sum']})
->first->get_column('sum') || 0;
}
$c->stash->{finishedBuilds} = $c->model('DB::Builds')->search(
{project => $projectName, finished => 1});
$c->stash->{succeededBuilds} = $c->model('DB::Builds')->search(
{project => $projectName, finished => 1, buildStatus => 0},
{join => 'resultInfo'});
$c->stash->{scheduledBuilds} = $c->model('DB::Builds')->search(
{project => $projectName, finished => 0});
$c->stash->{busyBuilds} = $c->model('DB::Builds')->search(
{project => $projectName, finished => 0, busy => 1},
{join => 'schedulingInfo'});
$c->stash->{totalBuildTime} = $c->model('DB::Builds')->search(
{project => $projectName},
{join => 'resultInfo', select => {sum => 'stoptime - starttime'}, as => ['sum']})
->first->get_column('sum');
$c->stash->{totalBuildTime} = 0 unless defined $c->stash->{totalBuildTime};
getBuildStats($c, scalar $project->builds);
</table>
[% END %]
[% BLOCK showBuildStats %]
<table class="layoutTable">
<tr>
<th>Finished builds:</th>
<td>[% finishedBuilds %]</td>
</tr>
<tr>
<th><img src="/static/images/success.gif" /> Succeeded builds:</th>
<td>[% succeededBuilds %]</td>
</tr>
<tr>
<th><img src="/static/images/failure.gif" /> Failed builds:</th>
<td>[% finishedBuilds - succeededBuilds %]</td>
</tr>
<tr>
<th>Total build time:</th>
<td>[% totalBuildTime %]s</td>
</tr>
<tr>
<th>Scheduled builds:</th>
<td>[% scheduledBuilds %]</td>
</tr>
<tr>
<th>Currently executing builds:</th>
<td>[% busyBuilds %]</td>
</tr>
<table class="layoutTable">
<tr>
<th>Finished builds:</th>
<td>[% finishedBuilds %]</td>
</tr>
<tr>
<th><img src="/static/images/success.gif" /> Succeeded builds:</th>
<td>[% succeededBuilds %]</td>
</tr>
<tr>
<th><img src="/static/images/failure.gif" /> Failed builds:</th>
<td>[% finishedBuilds - succeededBuilds %]</td>
</tr>
<tr>
<th>Total build time:</th>
<td>[% totalBuildTime %]s</td>
</tr>
<tr>
<th>Scheduled builds:</th>
<td>[% scheduledBuilds %]</td>
</tr>
<tr>
<th>Currently executing builds:</th>
<td>[% busyBuilds %]</td>
</tr>
</table>
[% PROCESS showBuildStats %]