Profile(3pm)

πŸ“¦
version 1.0 Β· 3 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– 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 uses Time::HiRes to clock the wall time, and the old standby times() 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 πŸ“

  1. Add "use DBIx::Profile" or execute "perl -MDBIx::Profile <program>"
  2. Optional: add $dbh->printProfile (it will execute during disconnect otherwise)
  3. Run code
  4. Data output will happen at printProfile or $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 🌈


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