Dbi profiling plugin
# Set env in apache or in perl. $ENV{DBI_PROFILE} = '2/CGI::Application::Plugin::DBIProfile::Driver'; use CGI::Application::Plugin::DevPopup; use CGI::Application::Plugin::DBIProfile; The rest of your application follows ...
To install this module, run the following commands:
perl Makefile.PL make make test make install
CGI::Application::Plugin::DBIProfile provides popup (using CAP::DevPopup if available) holding \s-1DBI\s0 Profile information (see DBI::Profile, DBI::ProfileDumper). It will output both graphed output and a DBI::ProfileDumper report.
To enable, set the \s-1DBI_PROFILE\s0 environment variables. For example
SetVar DBI_PROFILE 2/CGI::Application::Plugin::DBIProfile::Driver SetVar CAP_DBIPROFILE_EXEC 1
PerlSetVar DBI_PROFILE 2/CGI::Application::Plugin::DBIProfile::Driver PerlSetVar CAP_DBIPROFILE_EXEC 1
BEGIN { $ENV{DBI_PROFILE} = '2/CGI::Application::Plugin::DBIProfile::Driver'; $ENV{CAP_DBIPROFILE_EXEC} = 1; }
If you disable it, be sure to unset the \s-1DBI_PROFILE\s0 env var, as it will continue to accumulate stats regardless of the setting of \s-1CAP_DBIPROFILE_EXEC\s0, you just won't see them.
It has two modes of opperation; per-request or per-process. In a \s-1CGI\s0 environment, there is no difference.
CAP_DBIPROFILE_PERPROCESS 1
Under mod_perl, the per-request setup will show the \s-1DBI\s0 Profile specific to each page hit. The per-process setup will show the \s-1DBI\s0 Profile that has accumulated for the life of the apache process you are hitting.
Please note, running under the per-process setting can cause your memory usage to grow significantly, as the profile data is never cleared.
The default graphing module is CGI::Application::Plugin::DBIProfile::Graph::HTML, which generates a minimal inline \s-1HTML\s0 graph. To change which graphing plugin is used, it's just another environment variable (no need to set this if you like the default).
CAP_DBIPROFILE_GRAPHMODULE Your::Graph::Module::Name
Please see CGI::Application::Plugin::DBIProfile::Graph::HTML for information on writing new graph modules.
Tests. None exist at this time.
Other graphing plugins (Plotr, Open Flash Chart, GraphML using Graph::Easy).
Add checks to be sure $dbh->{Profile} isn't disabled (probably better in ::Driver).
Optional:
GD::Graph For CGI::Application::Plugin::DBIProfile::Graph::GDGraphInline support.
SVG::TT::Graph For CGI::Application::Plugin::DBIProfile::Graph::SVGTT support.
HTML::BarGraph For CGI::Application::Plugin::DBIProfile::Graph::HTMLBarGraph support.
To Sam Tregar, for the original codebase on which this was based, and DBI::ProfileDumper itself.
Sam Tregar, C<< <[email protected]> >> Joshua I Miller, C<< <[email protected]> >>
Please report any bugs or feature requests to [email protected], or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-DBIProfile <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=CGI-Application-Plugin-DBIProfile>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
Copyright 2007 Joshua Miller, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.