Data::...ofiler(3pm)
๐ธ NAME ๐ธ
okay so this is the Data::...ofiler(3pm) manual page from the User Contributed Perl Documentation set, and it's all about Data::ObjectDriver::Profiler โ Query profiling ๐
โจ. That's the vibe: your queries, but with receipts.
โจ SYNOPSIS โจ
bestie, here's the quickstart, no cap:
my $profiler = Data::ObjectDriver->profiler;
my $stats = $profiler->statistics;
my $total = $stats->{'DBI:total_queries'};
my $log = $profiler->query_log;
$profiler->reset;
๐ USAGE ๐
๐ฆ $Data::ObjectDriver::PROFILE ๐ฆ
To turn on profiling, set $Data::ObjectDriver::PROFILE to a true value. Alternatively, you can set the DOD_PROFILE environment variable to a true value before starting your application. iykyk โจ
๐
Data::ObjectDriver->profiler ๐
Profiling is global to Data::ObjectDriver, so the Profiler object is a global instance variable. To get it, call Data::ObjectDriver->profiler, which returns a Data::ObjectDriver::Profiler object. ๐ซถ
๐ $profiler->statistics ๐
Returns a hash reference of statistics about the queries that have been executed. ๐
๐ฆ $profiler->query_log ๐ฆ
Returns a reference to an array of SQL queries as they were handed off to DBI. This means that placeholder variables are not substituted, so you'll end up with queries in the query log like "SELECT title, difficulty FROM recipe WHERE recipe_id = ?". ๐
๐ $profiler->query_frequency ๐
Returns a reference to a hash containing, as keys, all of the SQL statements in the query log, where the value for each of the keys is a number representing the number of times the query was executed. ๐
๐ $profiler->reset ๐
Resets the statistics and the query log. fresh start energy โจ
๐ $profiler->total_queries ๐
Returns the total number of queries currently logged in the profiler. ๐งฎ
๐ $profiler->report_queries_by_type ๐
Returns a string containing a pretty report of information about the current number of each type of query in the profiler (e.g. "SELECT", "INSERT"). ๐
โญ $profiler->report_query_frequency โญ
Returns a string containing a pretty report of information about the current query frequency information in the profiler. ๐
mwah ๐ that's the whole page. brought to you by perl v5.42.0, dated 2024-10-24. slay ๐ซถโจ
๐ฆ where this page comes from
- opensuse-leap 16.0: perl-Data-ObjectDriver 0.230.0-bp160.1.12 ยท Artistic-1.0 OR GPL-1.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms