Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Using Devel::NYTProf with CGI::Application

by jvector (Friar)
on Aug 08, 2012 at 13:52 UTC ( [id://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?

Replies are listed 'Best First'.
Re: Using Devel::NYTProf with CGI::Application
by rsteiner (Scribe) 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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-03-29 09:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found