line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
## no critic (RequireUseStrict) |
2
|
|
|
|
|
|
|
package Plack::Middleware::Debug::Recorder; |
3
|
|
|
|
|
|
|
$Plack::Middleware::Debug::Recorder::VERSION = '0.06'; |
4
|
|
|
|
|
|
|
## use critic (RequireUseStrict) |
5
|
1
|
|
|
1
|
|
993
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
6
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
40
|
|
7
|
1
|
|
|
1
|
|
7
|
use parent 'Plack::Middleware::Debug::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub run { |
10
|
14
|
|
|
14
|
1
|
141583
|
my ( $self, $env, $panel ) = @_; |
11
|
|
|
|
|
|
|
|
12
|
14
|
|
|
|
|
41
|
$panel->title('Recorder'); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
return sub { |
15
|
14
|
|
|
14
|
|
543
|
my ( $res ) = @_; |
16
|
|
|
|
|
|
|
|
17
|
14
|
100
|
|
|
|
67
|
unless(exists $env->{'Plack::Middleware::Recorder.active'}) { |
18
|
1
|
|
|
|
|
5
|
$panel->disabled(1); |
19
|
1
|
|
|
|
|
6
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
13
|
100
|
|
|
|
49
|
my $status = $env->{'Plack::Middleware::Recorder.active'} |
23
|
|
|
|
|
|
|
? 'ON' |
24
|
|
|
|
|
|
|
: 'OFF'; |
25
|
|
|
|
|
|
|
|
26
|
13
|
100
|
|
|
|
54
|
my $color = $status eq 'ON' ? 'green' : 'red'; |
27
|
13
|
|
|
|
|
19
|
my $start_url = $env->{'Plack::Middleware::Recorder.start_url'}; |
28
|
13
|
|
|
|
|
30
|
my $stop_url = $env->{'Plack::Middleware::Recorder.stop_url'}; |
29
|
|
|
|
|
|
|
|
30
|
13
|
|
|
|
|
89
|
my $content = <
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
Request recording is $status |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
HTML |
56
|
|
|
|
|
|
|
|
57
|
13
|
|
|
|
|
46
|
$panel->content($content); |
58
|
14
|
|
|
|
|
153
|
}; |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# ABSTRACT: Debug panel to communicate with the Recorder middleware |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
__END__ |