Don't show how long a machine has been idle

Without an index on (machine, stoptime desc), this requires a
sequential scan. And adding a whole index for this seems
overkill. (Possibly the queue runner could maintain this info more
efficiently.)
This commit is contained in:
Eelco Dolstra 2015-07-10 15:34:29 +02:00
parent 3bb9e17e5c
commit 5919e911db
2 changed files with 1 additions and 13 deletions

View file

@ -111,14 +111,6 @@ sub machines :Local Args(0) {
# Add entry for localhost.
${$machines}{''} //= {};
# Get the last finished build step for each machine.
foreach my $m (keys %{$machines}) {
my $idle = $c->model('DB::BuildSteps')->find(
{ machine => "$m", stoptime => { '!=', undef } },
{ order_by => 'stoptime desc', rows => 1 });
${$machines}{$m}{'idle'} = $idle ? $idle->stoptime : 0;
}
$c->stash->{machines} = $machines;
$c->stash->{steps} = [ $c->model('DB::BuildSteps')->search(
{ finished => 0, 'me.busy' => 1, 'build.busy' => 1, },

View file

@ -41,11 +41,7 @@
[% END %]
[% END %]
[% IF idle == 1 %]
[% IF m.value.idle %]
<tr><td colspan="6">Idle for [% INCLUDE renderDuration duration = curTime - m.value.idle %]</td></tr>
[% ELSE %]
<tr><td colspan="6">Never used</td></tr>
[% END %]
<tr><td colspan="6">Idle</td></tr>
[% END %]
</tbody>
[% END %]