CGI::A...rofile(3pm)
π CGI::Application::Plugin::DBIProfile π
okay bestie, so this is a page from the User Contributed Perl Documentation, and it's about the CGI::Application::Plugin::DBIProfile module. It lives in the 3pm section of your man pages, which is giving "we're fancy perl library docs" energy. Let's get into it π«Ά
β¨ NAME β¨
CGI::Application::Plugin::DBIProfile β the DBI profiling plugin, no cap.
πΈ SYNOPSIS πΈ
# 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
...
π INSTALLATION π
to install this module you literally just run these commands, in this order, that's it:
perl Makefile.PL
make
make test
make install
π¦ DESCRIPTION π¦
CGI::Application::Plugin::DBIProfile gives you a popup (it uses CAP::DevPopup if that's available, iykyk) that holds your DBI Profile info β think DBI::Profile, think DBI::ProfileDumper. And it doesn't just do one thing, it serves both a graphed output and a DBI::ProfileDumper report. obsessed, honestly.
π CONFIGURATION π
to turn it on, you set the DBI_PROFILE environment variables. for example:
in apache config for cgi
SetVar DBI_PROFILE 2/CGI::Application::Plugin::DBIProfile::Driver
SetVar CAP_DBIPROFILE_EXEC 1
in apache config for mod_perl
PerlSetVar DBI_PROFILE 2/CGI::Application::Plugin::DBIProfile::Driver
PerlSetVar CAP_DBIPROFILE_EXEC 1
in your CAP module
BEGIN {
$ENV{DBI_PROFILE} = '2/CGI::Application::Plugin::DBIProfile::Driver';
$ENV{CAP_DBIPROFILE_EXEC} = 1;
}
β οΈ real talk: if you disable it, be sure to unset theDBI_PROFILEenv var. because it will keep on accumulating stats regardless of whatCAP_DBIPROFILE_EXECis set to β you just won't see them. it's giving "ghost stats" π
π MODES OF OPERATION π
it's got two modes of opperation (yes, spelled like that, we love her); per-request or per-process. and in a CGI environment, there's literally no difference between them.
- per-request β this is the default, bestie.
- per-process β set the following env var to a true value.
CAP_DBIPROFILE_PERPROCESS 1
under mod_perl, the per-request setup will show the DBI Profile specific to each page hit. meanwhile the per-process setup will show the DBI Profile that has accumulated for the life of the apache process you're hitting.
π¨ please note: running under the per-process setting can cause your memory usage to grow significantly, because the profile data is never cleared. not me watching your RAM just keep going up π
π§ GRAPHING PLUGINS π§
the default graphing module is CGI::Application::Plugin::DBIProfile::Graph::HTML, which generates a minimal inline HTML graph. want to change which graphing plugin gets used? it's just another environment variable, periodt. (and no need to set this at all if you like the default, obviously.)
CAP_DBIPROFILE_GRAPHMODULE Your::Graph::Module::Name
please see CGI::Application::Plugin::DBIProfile::Graph::HTML for info on writing new graph modules. go off, write your own π
β TODO β
- Tests. None exist at this time. (iconic of us, honestly.)
- 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).
π REQUIREMENTS π
Data::JavaScript
IO::Scalar
HTML::Template
Optional:
GD::Graph- For
CGI::Application::Plugin::DBIProfile::Graph::GDGraphInlinesupport.
- For
SVG::TT::Graph- For
CGI::Application::Plugin::DBIProfile::Graph::SVGTTsupport.
- For
HTML::BarGraph- For
CGI::Application::Plugin::DBIProfile::Graph::HTMLBarGraphsupport.
- For
π SEE ALSO π
CGI::Application
CGI::Application::Plugin::DevPopup
CGI::Application::Plugin::DBIProfile::Data
CGI::Application::Plugin::DBIProfile::Driver
CGI::Application::Plugin::DBIProfile::Graph::HTML
CGI::Application::Plugin::DBIProfile::Graph::HTML::Horizontal
CGI::Application::Plugin::DBIProfile::Graph::HTMLBarGraph
CGI::Application::Plugin::DBIProfile::Graph::GDGraphInline
CGI::Application::Plugin::DBIProfile::Graph::SVGTT
π SPECIAL THANKS π
to Sam Tregar, for the original codebase on which this was based, and DBI::ProfileDumper itself. thank you for your service, fr fr π«‘
π AUTHOR π
Sam Tregar, C<< <sam@tregar.com> >>
Joshua I Miller, C<< <unrtst@cpan.org> >>
π BUGS π
please report any bugs or feature requests to bug-cgi-application-plugin-dbiprofile@rt.cpan.org, or through the web interface at <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. it's a whole chain of notifying, it's giving group chat energy π²
π COPYRIGHT & LICENSE π
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.
and that's the whole page, bestie π
this was documented by the User Contributed Perl Documentation crew, from perl v5.36.0, dated 2022-11-19. go profile those queries, slay, and remember: unset your env vars β¨π¦π
π¦ where this page comes from
- debian bookworm: libcgi-application-plugin-dbiprofile-perl 0.07-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcgi-application-plugin-dbiprofile-perl 0.07-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcgi-application-plugin-dbiprofile-perl 0.07-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcgi-application-plugin-dbiprofile-perl 0.07-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcgi-application-plugin-dbiprofile-perl 0.07-4 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms