Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Using Devel::NYTProf with CGI::Application

by jvector (Friar)
on Aug 08, 2012 at 13:52 UTC ( #986281=perlquestion: print w/ replies, xml ) Need Help??
jvector has asked for the wisdom of the Perl Monks concerning the following question:

Salutations,

I am interested in profiling a web application built with CGI::Application, using Devel::NYTProf.

The docs for NYTProf recommend running a Perl file directly from the command line; or, for profiling under Apache, putting a PerlModule line in httpd.conf. However, this latter method presupposes that one has mod_perl enabled which is not the case in my environment.

I've tried, from the command line, running individual test scripts from the t/ directory but I would quite like to get a profile of the site whilst it's being used from a browser session.

Is that a sensible/reasonable thing to be seeking, and if so can it be done?

Comment on Using Devel::NYTProf with CGI::Application
Re: Using Devel::NYTProf with CGI::Application
by rsteiner (Sexton) on Sep 26, 2012 at 17:21 UTC

    Yes, you can do this.

    Just modify the shebang line of your CGI::Application Instance script to something like the following:

    #!/usr/bin/perl -d:NYTProf

    The output file should be created in the same directory as the instance script.

      Thank you very much - that Just Worked! And I do apologise for the late reply - I have only just seen this.
      Gr8 .. Thanks a lot :)
      Hi.. But this file is NYTprof.out is not in readable format. I tried to open it with Browser (ie, mozilla).. but no success.plz advise.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://986281]
Approved by marto
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2014-12-27 07:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls