Hello all.  I'm working on a project to produce a graphical frontend
for DBI::ProfileDumper for use with CGI::Application called
CGI::Application::Plugin::DBIProfile.  (Preview here:
http://sam.tregar.com/dbiprof_progress.png)

Things are working fine in mod_cgi but mod_perl is another story.  The
reason is that under mod_perl it's common to keep DBI connections open
across requests.  The aim of the profiler is to profile the DBI usage
pattern of a single request, so I need a way to reset the profiler at
the start of each request and dump the results at the end.

Here's what I propose:

  # start of a request, reset the profiler and point it at a new file
  $dbh->{Profile}->reset();
  $dbh->{Profile}->File($new_temp_file);

  # time passes

  # end the request as usual
  $dbh->{Profile}->flush_to_disk();

Does this make sense?  One alternative would be to write the second
line as:

  $dbh->{Profile}->{File} = $new_temp_file;

It makes me squirm but it does follow an established DBI pattern of
allowing direct access to an object's hash keys.

-sam

Reply via email to