From 9cebf03a4549dc7670db1db5d545f7b63337095c Mon Sep 17 00:00:00 2001 From: Rob Vermaas Date: Fri, 12 Feb 2010 10:19:24 +0000 Subject: [PATCH] * hydra: queue stats (nr running builds / nr queued builds) --- src/lib/Hydra/Controller/Root.pm | 4 ++++ src/root/topbar.tt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/Hydra/Controller/Root.pm b/src/lib/Hydra/Controller/Root.pm index c7fe52cb..f763e267 100644 --- a/src/lib/Hydra/Controller/Root.pm +++ b/src/lib/Hydra/Controller/Root.pm @@ -16,6 +16,10 @@ sub begin :Private { $c->stash->{curUri} = $c->request->uri; $c->stash->{version} = $ENV{"HYDRA_RELEASE"} || ""; $c->stash->{nixVersion} = $ENV{"NIX_RELEASE"} || ""; + + $c->stash->{nrRunningBuilds} = $c->model('DB::BuildSchedulingInfo')->search({ busy => 1 }, {})->count(); + $c->stash->{nrQueuedBuilds} = $c->model('DB::BuildSchedulingInfo')->count(); + } diff --git a/src/root/topbar.tt b/src/root/topbar.tt index 2c363bb9..d7bb0443 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -23,7 +23,7 @@ title = "Projects" %] [% INCLUDE makeLink uri = c.uri_for(c.controller('Root').action_for('queue')) - title = "Queue" %] + title = "Queue" %] ([% nrRunningBuilds %]/[% nrQueuedBuilds %]) [% INCLUDE makeLink uri = c.uri_for(c.controller('Root').action_for('all')) title = "All builds" %]