Created
May 8, 2014 14:56
-
-
Save dann/8b031a1d379208a9ec72 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
iff --git lib/Plack/Middleware/Profiler/NYTProf.pm lib/Plack/Middleware/Profiler/NYTProf.pm | |
index 6990cd2..8b66cc2 100644 | |
--- lib/Plack/Middleware/Profiler/NYTProf.pm | |
+++ lib/Plack/Middleware/Profiler/NYTProf.pm | |
@@ -27,6 +27,17 @@ use constant PROFILER_ENABLED => 'psgix.profiler.nytprof.enabled'; | |
my %PROFILER_SETUPED; | |
+BEGIN { | |
+ if (!$ENV{NYTPROF}) { | |
+ $ENV{NYTPROF} = "file=/tmp/nytprof.$$.out:start=no:sigexit=int'"; | |
+ warn "NYTPROF env var not set, so defaulting to NYTPROF='$ENV{NYTPROF}'"; | |
+ } | |
+ | |
+ require Devel::NYTProf::Core; | |
+ require Devel::NYTProf; | |
+} | |
+ | |
+ | |
sub prepare_app { | |
my $self = shift; | |
@@ -38,11 +49,6 @@ sub prepare_app { | |
$self->_setup_report_dir; | |
$self->_setup_nytprofhtml_path; | |
- $ENV{NYTPROF} = $self->env_nytprof || 'start=no:sigexit=int'; | |
- | |
- # NYTPROF environment variable is set in Devel::NYTProf::Core | |
- # so, we load Devel::NYTProf here. | |
- require Devel::NYTProf; | |
DB::disable_profile(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment