29 Aug 2000 21:53:21 UTC
- Distribution: DBIx-Profile
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (4)
- Testers (55 / 0 / 0)
- KwaliteeBus factor: 0
- % Coverage
- License: unknown
- Activity24 month
- Download (4.63KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
DBIx::Profile - DBI query profiler Version 1.0 Copyright (c) 1999,2000 Jeff Lathan, Kerry Clendinning. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
use DBIx::Profile; or "perl -MDBIx::Profile <program>" use DBI; $dbh->printProfile();
DBIx::Profile is a quick and easy, and mostly transparent, profiler for scripts using DBI. It collects information on the query level, and keeps track of first, failed, normal, and total amounts (count, wall clock, cput time) for each function on the query. NOTE: DBIx::Profile use Time::HiRes to clock the wall time and the old standby times() to clock the cpu time. The cpu time is pretty coarse. DBIx::Profile can also trace the execution of queries. It will print a timestamp and the query that was called. This is optional, and occurs only when the environment variable DBIXPROFILETRACE is set to 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.
1) Add "use DBIx::Profile" or execute "perl -MDBIx::Profile <program>" 2) Optional: add $dbh->printProfile (will execute during disconnect otherwise) 3) Run code 4) Data output will happen at printProfile or $dbh->disconnect;
printProfile $dbh->printProfile(); Will print out the data collected. If this is not called before disconnect, disconnect will call printProfile. setLogFile $dbh->setLogFile("ProfileOutput.txt"); Will save all output to the file.
Jeff Lathan, email@example.com Kerry Clendinning, firstname.lastname@example.org Aaron Lee, email@example.com Michael G Schwern, firstname.lastname@example.org
Module Install Instructions
To install DBIx::Profile, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install DBIx::Profile
For more information on module installation, please visit the detailed CPAN module installation guide.