Plack-App-Gearman-Status
view release on metacpan or search on metacpan
lib/Plack/App/Gearman/Status.pm view on Meta::CPAN
<th>Function</th>
<th>Total</th>
<th>Running</th>
<th>Available Workers</th>
<th>Queue</th>
</tr>
<% for my $status (@{$job_server_status->{status}}) { %>
<tr>
<td><%= $status->name() %></td>
<td><%= $status->running() %></td>
<td><%= $status->busy() %></td>
<td><%= $status->free() %></td>
<td><%= $status->queue() %></td>
</tr>
<% } %>
</table>
<% } %>
<% } %>
</body>
</html>
EOTPL
t/lib/Plack/App/Gearman/StatusTest.pm view on Meta::CPAN
client => sub {
my ($port) = @_;
my $app = Plack::App::Gearman::Status->new({
job_servers => ['127.0.0.1:'.$port],
});
is_deeply($app->get_status(), [{
job_server => '127.0.0.1:'.$port,
version => '0.13',
status => [{
busy => 2,
free => 1,
name => 'add',
queue => 1,
running => 3
}],
workers => [{
client_id => '-',
file_descriptor => 8432,
functions => [ 'job' ],
ip_address => '192.168.0.1'
( run in 0.846 second using v1.01-cache-2.11-cpan-87723dcf8b7 )