Add a more concise queue page

The old page didn't scale very well if you have 150K builds in the
queue, in fact it tended to make browsers hang. The new one just
shows, for each jobset, the number of queued builds. The actual builds
can be seen by going to the corresponding jobset page and looking at
the evals.
This commit is contained in:
Eelco Dolstra 2016-03-08 19:44:51 +01:00
parent b77a43b83d
commit 49a4639377
3 changed files with 45 additions and 1 deletions

View file

@ -102,6 +102,17 @@ sub queue_GET {
} }
sub queue_summary :Local :Path('queue-summary') :Args(0) {
my ($self, $c) = @_;
$c->stash->{template} = 'queue-summary.tt';
$c->stash->{queued} = $c->model('DB')->schema->storage->dbh->selectall_arrayref(
"select project, jobset, count(*) as queued, min(timestamp) as oldest, max(timestamp) as newest from Builds " .
"where finished = 0 group by project, jobset order by queued desc",
{ Slice => {} });
}
sub status :Local :Args(0) :ActionClass('REST') { } sub status :Local :Args(0) :ActionClass('REST') { }
sub status_GET { sub status_GET {

33
src/root/queue-summary.tt Normal file
View file

@ -0,0 +1,33 @@
[% WRAPPER layout.tt title="Queue summary" %]
[% PROCESS common.tt %]
[% IF queued.size == 0 %]
<div class="alert alert-info">There are no pending builds.</div>
[% ELSE %]
<table class="table table-striped table-condensed clickable-rows">
<thead>
<tr>
<th>Jobset</th>
<th># Queued</th>
<th>Oldest queued</th>
<th>Newest queued</th>
</tr>
</thead>
<tdata>
[% FOREACH j IN queued %]
<tr>
<td>[% INCLUDE renderFullJobsetName project=j.project jobset=j.jobset %]</td>
<td>[% HTML.escape(j.queued) %]</td>
<td>[% INCLUDE renderRelativeDate timestamp=j.oldest %]</td>
<td>[% INCLUDE renderRelativeDate timestamp=j.newest %]</td>
</tr>
[% END %]
</tdata>
</table>
[% END %]
[% END %]

View file

@ -17,7 +17,7 @@
[% WRAPPER makeSubMenu title="Status" %] [% WRAPPER makeSubMenu title="Status" %]
[% INCLUDE menuItem [% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('queue')) uri = c.uri_for(c.controller('Root').action_for('queue_summary'))
title = "Queue ("_ nrRunningBuilds _"/"_ nrQueuedBuilds _")" %] title = "Queue ("_ nrRunningBuilds _"/"_ nrQueuedBuilds _")" %]
[% INCLUDE menuItem [% INCLUDE menuItem
uri = c.uri_for(c.controller('Root').action_for('status')) uri = c.uri_for(c.controller('Root').action_for('status'))