| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Mojo::Debugbar; |
|
2
|
1
|
|
|
1
|
|
69513
|
use Mojo::Base -base; |
|
|
1
|
|
|
|
|
192337
|
|
|
|
1
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
|
|
|
|
4
|
1
|
|
|
1
|
|
759
|
use Mojo::Debugbar::Monitors; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
8
|
|
|
5
|
1
|
|
|
1
|
|
501
|
use Mojo::Loader qw(load_class); |
|
|
1
|
|
|
|
|
35926
|
|
|
|
1
|
|
|
|
|
66
|
|
|
6
|
1
|
|
|
1
|
|
541
|
use Mojo::Server; |
|
|
1
|
|
|
|
|
10360
|
|
|
|
1
|
|
|
|
|
27
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.0.2'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has 'app' => sub { Mojo::Server->new->build_app('Mojo::HelloWorld') }, weak => 1; |
|
11
|
|
|
|
|
|
|
has 'config' => sub {{ |
|
12
|
|
|
|
|
|
|
hide_empty => 0, |
|
13
|
|
|
|
|
|
|
monitors => [ |
|
14
|
|
|
|
|
|
|
'Mojo::Debugbar::Monitor::Request', |
|
15
|
|
|
|
|
|
|
'Mojo::Debugbar::Monitor::DBIx', |
|
16
|
|
|
|
|
|
|
'Mojo::Debugbar::Monitor::Template', |
|
17
|
|
|
|
|
|
|
'Mojo::Debugbar::Monitor::ValidationTiny', |
|
18
|
|
|
|
|
|
|
], |
|
19
|
|
|
|
|
|
|
}}; |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has 'monitors' => sub { |
|
22
|
|
|
|
|
|
|
my $self = shift; |
|
23
|
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my @monitors; |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
foreach my $module (@{ $self->config->{ monitors } || [] }) { |
|
27
|
|
|
|
|
|
|
my $monitor = _monitor($module, 1); |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
push(@monitors, $monitor->new(app => $self->app)); |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
return Mojo::Debugbar::Monitors->new( |
|
33
|
|
|
|
|
|
|
registered => \@monitors, |
|
34
|
|
|
|
|
|
|
hide_empty => $self->config->{ hide_empty }, |
|
35
|
|
|
|
|
|
|
); |
|
36
|
|
|
|
|
|
|
}; |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 render |
|
39
|
|
|
|
|
|
|
Proxy for monitors->render |
|
40
|
|
|
|
|
|
|
=cut |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub render { |
|
43
|
0
|
|
|
0
|
1
|
|
return shift->monitors->render; |
|
44
|
|
|
|
|
|
|
} |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head2 stop |
|
47
|
|
|
|
|
|
|
Proxy for monitors->stop |
|
48
|
|
|
|
|
|
|
=cut |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub stop { |
|
51
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
52
|
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
$self->monitors->stop; |
|
54
|
|
|
|
|
|
|
|
|
55
|
0
|
|
|
|
|
|
return $self; |
|
56
|
|
|
|
|
|
|
} |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head2 start |
|
59
|
|
|
|
|
|
|
Proxy for monitors->start |
|
60
|
|
|
|
|
|
|
=cut |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub start { |
|
63
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
64
|
|
|
|
|
|
|
|
|
65
|
0
|
|
|
|
|
|
$self->monitors->start; |
|
66
|
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return $self; |
|
68
|
|
|
|
|
|
|
} |
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head2 _monitor |
|
72
|
|
|
|
|
|
|
Load monitor |
|
73
|
|
|
|
|
|
|
=cut |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
sub _monitor { |
|
76
|
0
|
|
|
0
|
|
|
my ($module, $fatal) = @_; |
|
77
|
|
|
|
|
|
|
|
|
78
|
0
|
0
|
|
|
|
|
return $module->isa('Mojo::Debugbar::Monitor') ? $module : undef |
|
|
|
0
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
unless my $e = load_class $module; |
|
80
|
0
|
0
|
0
|
|
|
|
$fatal && ref $e ? die $e : return undef; |
|
81
|
|
|
|
|
|
|
} |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |