line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Middleware::LightProfile; |
2
|
|
|
|
|
|
|
$Plack::Middleware::LightProfile::VERSION = '0.002'; |
3
|
1
|
|
|
1
|
|
843
|
use parent qw/Plack::Middleware/; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
8
|
|
4
|
1
|
|
|
1
|
|
1010
|
use Process::SizeLimit::Core; |
|
1
|
|
|
|
|
26808
|
|
|
1
|
|
|
|
|
78
|
|
5
|
1
|
|
|
1
|
|
1077
|
use Time::HiRes qw/gettimeofday tv_interval/; |
|
1
|
|
|
|
|
2160
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
223
|
use Log::Any qw/$log/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
13
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub call { |
9
|
1
|
|
|
1
|
1
|
26095
|
my ($self, $env) = @_; |
10
|
1
|
|
|
|
|
14
|
my ($base_memory) = Process::SizeLimit::Core->_check_size(); |
11
|
1
|
|
|
|
|
12747
|
my $t0 = [gettimeofday()]; |
12
|
1
|
|
|
|
|
20
|
my $res = $self->app->($env); |
13
|
1
|
|
|
|
|
102
|
my $duration = tv_interval($t0); |
14
|
1
|
|
|
|
|
23
|
my ($end_memory) = Process::SizeLimit::Core->_check_size(); |
15
|
1
|
|
|
|
|
11366
|
my $memory_consumed = $end_memory - $base_memory; |
16
|
1
|
|
|
|
|
19
|
$log->infof("response time: %5.3f end memory: %d added memory: %d", $duration, $end_memory, $memory_consumed); |
17
|
1
|
|
|
|
|
73
|
return $res; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
1; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
__END__ |