Plack-App-Gearman-Status
view release on metacpan or search on metacpan
lib/Plack/App/Gearman/Status.pm view on Meta::CPAN
121122123124125126127128129130131132133134135136137138139140141
<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
323334353637383940414243444546474849505152client
=>
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.303 second using v1.01-cache-2.11-cpan-2b0bae70ee8 )