diff options
author | Oliver Stannard <oliver.stannard@linaro.org> | 2020-04-23 16:47:07 +0100 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@linaro.org> | 2020-04-23 16:56:48 +0100 |
commit | 8cf6b1a4d407a2ec5f9ae17f1dc525530fa0362c (patch) | |
tree | bee41b4739039819c51e1d9b05d363c26b07b756 | |
parent | 8b7841e37e7bd3d931aed345836efb1f37a3d884 (diff) |
Display build time on the bot monitoring page
Change-Id: Ic901b42afdbb01d7aa5248286f5e7d6607c4ec1c
-rwxr-xr-x | monitor/bot-status | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/monitor/bot-status b/monitor/bot-status index 963840d..d1a4986 100755 --- a/monitor/bot-status +++ b/monitor/bot-status @@ -85,7 +85,7 @@ foreach my $server (@$config) { print $temp "<tr><td colspan=5> </td><tr>\n"; print $temp "<tr><th colspan=5>$builder->{'name'}</td><tr>\n"; print $temp "<tr><th>Buildbot</th><th>Status</th><th>Comments</th>". - "<th>Build #</th><th>Commits</th></tr>\n"; + "<th>Build #</th><th>Commits</th><th>Time (minutes)</th></tr>\n"; foreach my $bot (@{$builder->{'bots'}}) { print $temp "<tr>\n"; my $status = $bot_cache{$BASE_URL.'/'.$bot->{'name'}}; @@ -110,6 +110,12 @@ foreach my $server (@$config) { } else { print $temp " <td> </td>\n"; } + if (defined $status->{'time'}) { + my $time = sprintf("%.0f", $status->{'time'} / 60); + print $temp " <td>$time</td>\n"; + } else { + print $temp " <td> </td>\n"; + } print $temp "</tr>\n"; } } @@ -174,6 +180,9 @@ sub get_status() { $status{'from'} = substr($first_rev, 0, 8); $status{'to'} = substr($last_rev, 0, 8); + # Elapsed time of the last build. + $status{'time'} = $json->{'times'}[1] - $json->{'times'}[0]; + return \%status; } |