1Data::ObjectDriver::ProUfsielrerC(o3nptmr)ibuted Perl DoDcautmae:n:tOabtjieocntDriver::Profiler(3pm)
2
3
4
6 Data::ObjectDriver::Profiler - Query profiling
7
9 my $profiler = Data::ObjectDriver->profiler;
10
11 my $stats = $profiler->statistics;
12 my $total = $stats->{'DBI:total_queries'};
13
14 my $log = $profiler->query_log;
15
16 $profiler->reset;
17
19 $Data::ObjectDriver::PROFILE
20 To turn on profiling, set $Data::ObjectDriver::PROFILE to a true value.
21 Alternatively, you can set the DOD_PROFILE environment variable to a
22 true value before starting your application.
23
24 Data::ObjectDriver->profiler
25 Profiling is global to Data::ObjectDriver, so the Profiler object is a
26 global instance variable. To get it, call Data::ObjectDriver->profiler,
27 which returns a Data::ObjectDriver::Profiler object.
28
29 $profiler->statistics
30 Returns a hash reference of statistics about the queries that have been
31 executed.
32
33 $profiler->query_log
34 Returns a reference to an array of SQL queries as they were handed off
35 to DBI. This means that placeholder variables are not substituted, so
36 you'll end up with queries in the query log like "SELECT title,
37 difficulty FROM recipe WHERE recipe_id = ?".
38
39 $profiler->query_frequency
40 Returns a reference to a hash containing, as keys, all of the SQL
41 statements in the query log, where the value for each of the keys is a
42 number representing the number of times the query was executed.
43
44 $profiler->reset
45 Resets the statistics and the query log.
46
47 $profiler->total_queries
48 Returns the total number of queries currently logged in the profiler.
49
50 $profiler->report_queries_by_type
51 Returns a string containing a pretty report of information about the
52 current number of each type of query in the profiler (e.g. "SELECT",
53 "INSERT").
54
55 $profiler->report_query_frequency
56 Returns a string containing a pretty report of information about the
57 current query frequency information in the profiler.
58
59
60
61perl v5.28.0 2017-04-19 Data::ObjectDriver::Profiler(3pm)