File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,10 @@ function exec_web() {
122122 elif [ " $otobo_devel " = " development" ]; then
123123 exec plackup --server Gazelle --port 5000 bin/psgi-bin/otobo.psgi
124124
125+ # For activating profiling. Loading the middleware tells otobo.psgi that profiling is enabled.
126+ elif [ " $otobo_devel " = " nytprof" ]; then
127+ exec plackup -M Plack::Middleware::Profiler::NYTProf --port 5000 bin/psgi-bin/otobo.psgi
128+
125129 # For being very sure that all modules are reloaded and the config being read again
126130 elif [ " $otobo_devel " = " shotgun" ]; then
127131 exec plackup --loader Shotgun --port 5000 bin/psgi-bin/otobo.psgi
Original file line number Diff line number Diff line change @@ -100,8 +100,10 @@ eval {
100100 require Net::DNS;
101101};
102102
103- # Activate profiling only when Plack::Middleware::Profiler::NYTProf is installed.
104- my $ProfilingIsActive = 0;
103+ # Activate profiling when Plack::Middleware::Profiler::NYTProf is loaded.
104+ # Passing the option "-M Plack::Middleware::Profiler::NYTProf" to plackup does the trick.
105+ my $ProfilingIsActive = $INC {' Plack/Middleware/Profiler/NYTProf.pm' } ? 1: 0;
106+ # my $ProfilingIsActive = 1; # uncomment for activating profiling
105107
106108# The OTOBO home is determined from the location of otobo.psgi.
107109my $Home = abs_path(" $Bin /../.." );
You can’t perform that action at this time.
0 commit comments