Profile(3pm)
π NAME π
okay so bestie, meet DBIx::Profile β a DBI query profiler</p> π and we're on Version 1.0, no cap.
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. slay, it's open source β¨
β¨ SYNOPSIS β¨
use DBIx::Profile; or "perl -MDBIx::Profile <program>"
use DBI;
$dbh->printProfile();
like literally that's it, three lines, go off π
π¦ DESCRIPTION π¦
DBIx::Profile is your lowkey, quick and easy, and mostly transparent, profiler for scripts that use DBI. It gathers info at the query level, and it keeps track of first, failed, normal, and total amounts β that's count, wall clock, and CPU time β for every single function on the query. it's giving accountability π
β οΈ NOTE: DBIx::Profile usesTime::HiResto clock the wall time, and the old standbytimes()to clock the CPU time. The CPU time is pretty coarse. like, chunky. don't @ me π
DBIx::Profile can also trace the execution of queries. It will print a timestamp and the query that was called. This is optional, and it only kicks in when the environment variable DBIXPROFILETRACE is set to 1. (ex: (bash) export DBIXPROFILETRACE=1). main character feature fr π¦
Not all DBI methods are profiled at this time. π Except for replacing the existing use and connect statements, DBIx::Profile lets DBI functions be called as usual on handles.
It prints information to STDERR, prefaced with the pid. iykyk π«Ά
π RECIPE π
- Add
"use DBIx::Profile"or execute"perl -MDBIx::Profile <program>" - Optional: add
$dbh->printProfile(it will execute during disconnect otherwise) - Run code
- Data output will happen at
printProfileor$dbh->disconnect;
literally a four-step glow-up routine, periodt π
πΈ METHODS πΈ
printProfile π
$dbh->printProfile();
Will print out the data collected. And if this is not called before disconnect, then disconnect will call printProfile for you. it's got your back bestie π«Ά
setLogFile π
$dbh->setLogFile("ProfileOutput.txt");
Will save all output to the file. keep the receipts, queen β¨
π AUTHORS π
- Jeff Lathan,
lathan@pobox.com - Kerry Clendinning,
kerry@deja.com - Aaron Lee,
aaron@pointx.org - Michael G Schwern,
schwern@pobox.com
the whole squad ate π₯
π SEE ALSO π
L<perl(1)>L<DBI>
that's the whole vibe check bestie β this page came from perl v5.36.0 and it's dated 2022-10-16, filed under Profile(3pm) in User Contributed Perl Documentation. go profile something iconic ππ
π¦ where this page comes from
- ubuntu noble: libdbix-profile-perl 1.0-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libdbix-profile-perl 1.0-7 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libdbix-profile-perl 1.0-7 Β· 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