
Plack::Middleware::Profiler::NYTProf - Middleware for Profiling a Plack App

use Plack::Builder;
builder {
enable 'Profiler::NYTProf';
[ '200', [], [ 'Hello Profiler' ] ];
};

Plack::Middleware::Profiler::NYTProf helps you to get profiles of Plack App.

NOTE that some options expect a code reference. Maybe, you feel it is complicated. However that will enable to control them programmably. It is more useful to your apps.
default
sub { 1 }
Use code reference if you want to enable profiling programmably This option is optional.
default
1
Devel::NYTProf doesn't generate HTML profiling report if you set 0 to this option. This option is optional.
This option set to $ENV{NYTPROF}. See Devel::NYTProf: NYTPROF ENVIRONMENT VARIABLE section. Actualy, Plack::Middleware::Profiler::NYTProf loads Devel::NYTProf lazy for setting $ENV by option.
default
'start=no'
NYTProf write profile data to this directory. The default directory is current directory. This option is optional.
default
sub { '.' }
The file name about profile. This options is optional.
default
sub { my $id = $_[1]->{PROFILE_ID}; return "nytprof.$id.out"; }
Generate ID for every profile. This option is optional.
default
sub { return $$ . "-" . Time::HiRes::gettimeofday; } )
The file name of dummy profile for NYTProf. This option is optional.
default
'nytprof.null.out'
This is the hook before profiling This option is optional.
This is the hook after profiling This option is optional.

This source is in Github:
http://github.com/dann/p5-plack-middleware-profiler-nytprof

Many thanks to: bayashi

Takatoshi Kitano <kitano.tk {at} gmail.com> Dai Okabayashi


This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.