views:

68

answers:

3

Is there a way to get this functionality under mod_perl2?

And can it be triggered via web requests as opposed to the command line? Or do I need to fake whatever $ENV variables and query strings and cookies that my script requires and use the command line somehow?

Google and CPAN searches all seem to point to things that either don't even support mod_perl to begin with, or do, but are old and don't mention mod_perl2.

A: 

Slightly different tactic here, but take a look at Apache2::ASP.

You can use Devel::Cover and Devel::NYTProf for code-coverage and code-profiling.

Example: code-coverage testing with Apache2::ASP

Example: code-profiling wih Apache2::ASP

Bonus - you can perform unit testing on your web application itself.

Disclaimer: I wrote Apache2::ASP.

JDrago
Unfortunately I'm limited to win32 PPMs at the moment, and there doesn't seem to be one for your module yet. :| Sorry, it did look promising from the web site...
Kev
A: 

There aren't any that fit the criteria.

Kev
A: 

Assuming you want to profile your perl code, and not the server itself, the profilers generally do not care if it's mod_perl or mod_perl2, the major difference is in the apache API modules and what you can get apache to do for you using perl.

Take a look at Devel::NYTProf (http://search.cpan.org/~timb/Devel-NYTProf-2.10/), it's relatively new, actively maintained and improved and provides some very nice profiling features.

Malcolm
Although it says it supports win32 and modperl2, I don't think it supports both at the same time. It crashes Apache immediately after starting, every time.
Kev
Did you build it against the same version of perl that your mod_perl uses? As it uses XS, that would be my first thing to check.
Malcolm