Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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:


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

Replies are listed 'Best First'.
Re: Using Devel::NYTProf with CGI::Application
by rsteiner (Beadle) 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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://986281]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2018-06-22 15:02 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (124 votes). Check out past polls.