DashProfiler::Apache - Hook DashProfiler into Apache mod_perl (v1 or v2)
To hook DashProfiler into Apache you add this to your httpd.conf:
PerlModule DashProfiler::Apache; PerlInitHandler DashProfiler::Apache::start_sample_period_all_profiles PerlCleanupHandler DashProfiler::Apache::end_sample_period_all_profiles PerlChildExitHandler DashProfiler::Apache::flush_all_profiles
You'll also need to define at least one profile. An easy way of doing that is to use DashProfiler::Auto to get a predefined profile called 'auto':
PerlModule DashProfiler::Auto;
Or you can define your own, like this:
PerlModule DashProfiler::Apache; <Perl> DashProfile->add_profile( foo => { ... } ); </Perl>
The DashProfiler module itself will work just fine with Apache. The DashProfiler::Apache just fine-tunes the integration in a few ways:
* Sets a precondition on start_sample_period_all_profiles() so that it only starts a period for 'initial' requests (where $r->is_initial_req is true). This is typically only relevant if your code uses $r->internal_redirect.
* Adds a simple trace mechanism so you can easily see which DashProfiler::Apache functions are called for which Apache handlers.
PerlModule DashProfiler::Apache; PerlInitHandler DashProfiler::Apache::start_sample_period_all_profiles PerlCleanupHandler DashProfiler::Apache::end_sample_period_all_profiles PerlChildExitHandler DashProfiler::Apache::flush_all_profiles <Perl> # files will be written to $spool_directory/dashprofiler.subsys.ppid.pid DashProfiler->add_profile('subsys', { granularity => 30, flush_interval => 60, add_exclusive_sample => 'other', spool_directory => '/tmp', # needs write permission for apache user }); </Perl>
DashProfiler by Tim Bunce, http://www.tim.bunce.name and http://blog.timbunce.org
The DashProfiler distribution is Copyright (c) 2007-2008 Tim Bunce. Ireland. All rights reserved.
You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.
To install DashProfiler, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DashProfiler
CPAN shell
perl -MCPAN -e shell install DashProfiler
For more information on module installation, please visit the detailed CPAN module installation guide.