CGI::A...rofile(3pm)

πŸ“¦
version 0.07 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 the DBI_PROFILE env var. because it will keep on accumulating stats regardless of what CAP_DBIPROFILE_EXEC is 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::GDGraphInline support.
  • SVG::TT::Graph
    • For CGI::Application::Plugin::DBIProfile::Graph::SVGTT support.
  • HTML::BarGraph
    • For CGI::Application::Plugin::DBIProfile::Graph::HTMLBarGraph support.

πŸ‘‘ 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 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