line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# ABSTRACT: Profile your Catalyst application with Devel::NYTProf |
2
|
|
|
|
|
|
|
package CatalystX::Profile; |
3
|
|
|
|
|
|
|
BEGIN { |
4
|
1
|
|
|
1
|
|
2521
|
$CatalystX::Profile::VERSION = '0.02'; |
5
|
|
|
|
|
|
|
} |
6
|
1
|
|
|
1
|
|
5
|
use Moose::Role; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
3953
|
use namespace::autoclean; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
507
|
use CatalystX::InjectComponent; |
|
1
|
|
|
|
|
3023
|
|
|
1
|
|
|
|
|
25
|
|
10
|
1
|
|
|
1
|
|
734
|
use Devel::NYTProf; |
|
1
|
|
|
|
|
1819
|
|
|
1
|
|
|
|
|
186
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
after 'setup_finalize' => sub { |
13
|
|
|
|
|
|
|
my $self = shift; |
14
|
|
|
|
|
|
|
$self->log->debug('Profiling is active'); |
15
|
|
|
|
|
|
|
DB::enable_profile(); |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
after 'setup_components' => sub { |
19
|
|
|
|
|
|
|
my $class = shift; |
20
|
|
|
|
|
|
|
CatalystX::InjectComponent->inject( |
21
|
|
|
|
|
|
|
into => $class, |
22
|
|
|
|
|
|
|
component => 'CatalystX::Profile::Controller::ControlProfiling', |
23
|
|
|
|
|
|
|
as => 'Controller::Profile' |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |
31
|
|
|
|
|
|
|
=pod |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
=head1 NAME |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
CatalystX::Profile - Profile your Catalyst application with Devel::NYTProf |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
=head1 VERSION |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
version 0.02 |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head1 SYNOPSIS |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
# In MyApp.pm |
44
|
|
|
|
|
|
|
use Catalyst qw( +CatalystX::Profile ); |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
export NYTPROF=start=no |
47
|
|
|
|
|
|
|
perl -d:NYTProf script/myapp_server.pl |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
... click around on your website ... |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Finish profiling: /profile/stop_profiling |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 DESCRIPTION |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
This (really basic for now) plugin adds support for profiling your |
56
|
|
|
|
|
|
|
Catalyst application, without profiling all the crap that happens |
57
|
|
|
|
|
|
|
during setup. This noise can make finding the real profiling stuff |
58
|
|
|
|
|
|
|
trickier, so profiling is disabled while this happens. |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 BUGS, WARNINGS, POTENTIAL HEALTH HAZARDS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This module is really new - but it does do what it says on the tin so |
63
|
|
|
|
|
|
|
far. But I really need some feedback! Please submit all feature |
64
|
|
|
|
|
|
|
suggestions either on here via RT, or just poke me on irc.perl.org |
65
|
|
|
|
|
|
|
(I'm aCiD2). |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 AUTHOR |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
Oliver Charles <oliver.g.charles@googlemail.com> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
This software is copyright (c) 2011 by Oliver Charles. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
76
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|