DBIx::Profile3pm
Usage
use DBIx::Profile; or "perl -MDBIx::Profile <program>"use DBI;$dbh->printProfile();
Overview
DBIx::Profile is a quick and easy, and mostly transparent, profilerfor scripts using DBI. It collects information on the querylevel, and keeps track of first, failed, normal, and total amounts(count, wall clock, CPU time) for each function on the query.NOTE: DBIx::Profile use Time::HiRes to clock the wall time andthe old standby times() to clock the CPU time. The CPU time ispretty coarse.DBIx::Profile can also trace the execution of queries. It will printa timestamp and the query that was called. This is optional, andoccurs only when the environment variable DBIXPROFILETRACE is setto 1. (ex: (bash) export DBIXPROFILETRACE=1).Not all DBI methods are profiled at this time.Except for replacing the existing "use" and "connect" statements,DBIx::Profile allows DBI functions to be called as usual on handles.Prints information to STDERR, prefaced with the pid.
Recipe
1) Add "use DBIx::Profile" or execute "perl -MDBIx::Profile <program>"2) Optional: add $dbh->printProfile (will execute duringdisconnect otherwise)3) Run code4) Data output will happen at printProfile or $dbh->disconnect;
Methods
printProfile$dbh->printProfile();Will print out the data collected.If this is not called before disconnect, disconnect will callprintProfile.setLogFile$dbh->setLogFile("ProfileOutput.txt");Will save all output to the file.
Releases
12 releases since Debian 3.0 (Woody); the text changed 4 times.