Plack-App-Gearman-Status

 view release on metacpan or  search on metacpan

lib/Plack/App/Gearman/Status.pm  view on Meta::CPAN

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
                                                <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

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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.303 second using v1.01-cache-2.11-cpan-2b0bae70ee8 )