dann > Plack-Middleware-Profiler-NYTProf-0.14 > Plack::Middleware::Profiler::NYTProf

Download:
Plack-Middleware-Profiler-NYTProf-0.14.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.14   Source   Latest Release: Plack-Middleware-Profiler-NYTProf-0.17

NAME ^

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

SYNOPSIS ^

    use Plack::Builder;

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

DESCRIPTION ^

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

Enabling this middleware will result in a huge performance penalty. It is intended for use in development only.

Read Devel::NYTProf documentation if you use it for production. Some options of Devel::NYTProf is useful to reduce profling overhead. See MAKING_NYTPROF_FASTER section of NYTProf's pod.

OPTIONS ^

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.

enable_profile

default

    sub { 1 }

Use code reference if you want to enable profiling programmably This option is optional.

enable_reporting

default

    1

Devel::NYTProf doesn't generate HTML profiling report if you set 0 to this option. This option is optional.

env_nytprof

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'
profiling_result_dir

NYTProf write profile data to this directory. The default directory is current directory. This option is optional.

default

    sub { '.' }
profiling_result_file_name

The file name about profile. This options is optional.

default

    sub { my $id = $_[1]->{PROFILE_ID}; return "nytprof.$id.out"; }
generate_profile_id

Generate ID for every profile. This option is optional.

default

    sub { return $$ . "-" . Time::HiRes::gettimeofday; } )
nullfile

The file name of dummy profile for NYTProf. This option is optional.

default

    'nytprof.null.out'
before_profile

This is the hook before profiling This option is optional.

after_profile

This is the hook after profiling This option is optional.

HOW TO SEE REPORT ^

  $ plackup -MPlack::App::Directory -e 'Plack::App::Directory->new({root => "./report"})->to_app'

SOURCE AVAILABILITY ^

This source is in Github:

  http://github.com/dann/p5-plack-middleware-profiler-nytprof

CONTRIBUTORS ^

Many thanks to: bayashi

AUTHOR ^

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

SEE ALSO ^

Devel::NYTProf

LICENSE ^

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

syntax highlighting: