| File | /usr/lib/perl5/vendor_perl/5.10.1/Epoll/View/Mail.pm |
| Statements Executed | 63 |
| Statement Execution Time | 2.93ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 3 | 1 | 1 | 855µs | 1.77s | Epoll::View::Mail::render |
| 1 | 1 | 1 | 140µs | 154µs | Epoll::View::Mail::BEGIN@6 |
| 1 | 1 | 1 | 78µs | 339µs | Epoll::View::Mail::BEGIN@4 |
| 1 | 1 | 1 | 51µs | 65µs | Epoll::View::Mail::BEGIN@3 |
| 1 | 1 | 1 | 40µs | 114µs | Epoll::View::Mail::BEGIN@7 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Epoll::View::Mail; | ||||
| 2 | |||||
| 3 | 3 | 91µs | 2 | 79µs | # spent 65µs (51+14) within Epoll::View::Mail::BEGIN@3 which was called
# once (51µs+14µs) by Catalyst::Utils::ensure_class_loaded at line 3 # spent 65µs making 1 call to Epoll::View::Mail::BEGIN@3
# spent 14µs making 1 call to strict::import |
| 4 | 3 | 141µs | 2 | 601µs | # spent 339µs (78+261) within Epoll::View::Mail::BEGIN@4 which was called
# once (78µs+261µs) by Catalyst::Utils::ensure_class_loaded at line 4 # spent 339µs making 1 call to Epoll::View::Mail::BEGIN@4
# spent 261µs making 1 call to base::import |
| 5 | 3 | 377µs | 2 | 30.5ms | use Mail::Mailer; # spent 30.5ms making 1 call to Epoll::View::Mail::BEGIN@5
# spent 9µs making 1 call to Mail::Mailer::import |
| 6 | 3 | 194µs | 2 | 169µs | # spent 154µs (140+14) within Epoll::View::Mail::BEGIN@6 which was called
# once (140µs+14µs) by Catalyst::Utils::ensure_class_loaded at line 6 # spent 154µs making 1 call to Epoll::View::Mail::BEGIN@6
# spent 14µs making 1 call to Catalyst::import |
| 7 | 3 | 1.15ms | 2 | 188µs | # spent 114µs (40+74) within Epoll::View::Mail::BEGIN@7 which was called
# once (40µs+74µs) by Catalyst::Utils::ensure_class_loaded at line 7 # spent 114µs making 1 call to Epoll::View::Mail::BEGIN@7
# spent 74µs making 1 call to Exporter::import |
| 8 | |||||
| 9 | 1 | 116µs | 2 | 7.07ms | __PACKAGE__->config( # spent 5.50ms making 1 call to Catalyst::Component::config
# spent 1.57ms making 1 call to Catalyst::path_to |
| 10 | TEMPLATE_EXTENSION => '.tt', | ||||
| 11 | INCLUDE_PATH => Epoll->path_to( 'root', 'mail' ), | ||||
| 12 | PLUGIN_BASE => 'Epoll::Template::Plugin', | ||||
| 13 | PRE_PROCESS => [ 'includes/loc.tt', ], | ||||
| 14 | ); | ||||
| 15 | |||||
| 16 | =head1 NAME | ||||
| 17 | |||||
| 18 | Epoll::View::TT - TT View for Epoll | ||||
| 19 | |||||
| 20 | =head1 DESCRIPTION | ||||
| 21 | |||||
| 22 | TT View for Epoll. | ||||
| 23 | |||||
| 24 | =cut | ||||
| 25 | |||||
| 26 | # spent 1.77s (855µs+1.77) within Epoll::View::Mail::render which was called 3 times, avg 589ms/call:
# 3 times (855µs+1.77s) by Catalyst::Action::execute at line 65 of Catalyst/Action.pm, avg 589ms/call | ||||
| 27 | 45 | 808µs | my ($self, $c, $template, $args) = @_; | ||
| 28 | |||||
| 29 | # Backup locale, change it for mail | ||||
| 30 | my $prev_language = $c->languages; # spent 7.83ms making 3 calls to Catalyst::Plugin::I18N::languages, avg 2.61ms/call | ||||
| 31 | $c->languages([ $c->req->param('mail_locale') ]) # spent 6.03ms making 3 calls to Catalyst::Plugin::I18N::languages, avg 2.01ms/call
# spent 3.15ms making 6 calls to Catalyst::Request::param, avg 524µs/call
# spent 122µs making 6 calls to Catalyst::req, avg 20µs/call | ||||
| 32 | if($c->req->param('mail_locale')); | ||||
| 33 | |||||
| 34 | $ENV{MAILADDRESS} = $args->{From}; | ||||
| 35 | my $mailer = new Mail::Mailer 'smtp', Server => (Epoll->config->{smtp} || '127.0.0.1'); # spent 53.4ms making 3 calls to Mail::Mailer::new, avg 17.8ms/call
# spent 3.04ms making 3 calls to Catalyst::config, avg 1.01ms/call | ||||
| 36 | eval { | ||||
| 37 | $mailer->open({ | ||||
| 38 | (map { $_ => $args->{$_} } grep { $_ !~ /^(mail)$/ } keys %{ $args || {}}), # spent 825ms making 3 calls to Mail::Mailer::open, avg 275ms/call
# spent 31µs making 12 calls to Epoll::View::Mail::CORE:match, avg 3µs/call | ||||
| 39 | 'Content-Type' => 'text/plain; charset=UTF-8; format=flowed', | ||||
| 40 | 'Content-Transfer-Encoding' => '8bit', | ||||
| 41 | 'X-Epoll-version' => $Epoll::DB::VERSION, | ||||
| 42 | }); | ||||
| 43 | print $mailer | ||||
| 44 | 1 | 41µs | 9 | 424ms | Catalyst::View::TT::render($self, $c, $template, { %{ $args->{mail} || {} }, c => $c }); # spent 420ms making 3 calls to Catalyst::View::TT::render, avg 140ms/call
# spent 2.10ms making 3 calls to Epoll::View::Mail::CORE:print, avg 699µs/call
# spent 2.05ms making 3 calls to Mail::Mailer::smtp::pipe::PRINT, avg 684µs/call |
| 45 | $mailer->close; # spent 438ms making 3 calls to Mail::Mailer::smtp::close, avg 146ms/call | ||||
| 46 | }; | ||||
| 47 | if ($@) { | ||||
| 48 | $c->stash->{mail_error} = $@; | ||||
| 49 | } | ||||
| 50 | # restore locale | ||||
| 51 | $c->languages($prev_language); # spent 8.09ms making 3 calls to Catalyst::Plugin::I18N::languages, avg 2.70ms/call | ||||
| 52 | } | ||||
| 53 | |||||
| 54 | =head1 SEE ALSO | ||||
| 55 | |||||
| 56 | L<Epoll> | ||||
| 57 | |||||
| 58 | =head1 AUTHOR | ||||
| 59 | |||||
| 60 | Thauvin Olivier | ||||
| 61 | |||||
| 62 | =head1 LICENSE | ||||
| 63 | |||||
| 64 | This library is free software, you can redistribute it and/or modify | ||||
| 65 | it under the same terms as Perl itself or CeCILL. | ||||
| 66 | |||||
| 67 | =cut | ||||
| 68 | |||||
| 69 | 1 | 19µs | 1; |