Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: e59d5b0487
Fetching contributors…

Cannot retrieve contributors at this time

29 lines (22 sloc) 0.716 kB
package Angelos::Controller::Plugin::ActionProfiler;
use Angelos::Plugin;
use Angelos::Logger;
use Time::HiRes qw(time);
has '__action_start_time' => ( is => 'rw', );
has '__action_end_time' => ( is => 'rw', );
before 'ACTION' => sub {
my ( $self, $c, $action, $params ) = @_;
$self->__action_start_time( time() );
};
after 'ACTION' => sub {
my ( $self, $c, $action, $params ) = @_;
$self->__action_end_time( time() );
my $elapsed = $self->__action_end_time - $self->__action_start_time;
my $message
= "action processing time:\naction: $action \ntime : $elapsed secs\n";
Angelos::Logger->instance->log(
level => 'info',
message => $message,
);
};
1;
Jump to Line
Something went wrong with that request. Please try again.