line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Qless::Queues; |
2
|
|
|
|
|
|
|
=head1 NAME |
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
Qless::Queues |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=cut |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
17
|
|
9
|
1
|
|
|
1
|
|
403
|
use Qless::Queue; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
28
|
|
10
|
1
|
|
|
1
|
|
8
|
use JSON::XS qw(decode_json); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
52
|
|
11
|
1
|
|
|
1
|
|
6
|
use Time::HiRes qw(); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
12
|
1
|
|
|
1
|
|
5
|
use Qless::Utils qw(fix_empty_array); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
179
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub new { |
15
|
0
|
|
|
0
|
0
|
|
my $class = shift; |
16
|
0
|
|
|
|
|
|
my ($client) = @_; |
17
|
|
|
|
|
|
|
|
18
|
0
|
0
|
|
|
|
|
$class = ref $class if ref $class; |
19
|
0
|
|
|
|
|
|
my $self = bless {}, $class; |
20
|
|
|
|
|
|
|
|
21
|
0
|
|
|
|
|
|
$self->{'client'} = $client; |
22
|
|
|
|
|
|
|
|
23
|
0
|
|
|
|
|
|
$self; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub counts { |
27
|
0
|
|
|
0
|
0
|
|
my ($self) = @_; |
28
|
0
|
|
|
|
|
|
my $results = decode_json($self->{'client'}->_queues([], Time::HiRes::time)); |
29
|
0
|
|
|
|
|
|
$results = fix_empty_array($results); |
30
|
0
|
|
|
|
|
|
return $results; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub item { |
34
|
0
|
|
|
0
|
0
|
|
my ($self, $name) = @_; |
35
|
0
|
|
|
|
|
|
return Qless::Queue->new($name, $self->{'client'}, $self->{'client'}->{'worker_name'}); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |