Commit 6af883e1 authored by Byron Jones's avatar Byron Jones

Bug 732440: Add SQL execution timings to buglist.cgi's debug output

r=LpSolit, r=LpSolit
parent 76c90bb4
...@@ -32,6 +32,7 @@ use Bugzilla::Status; ...@@ -32,6 +32,7 @@ use Bugzilla::Status;
use Bugzilla::Token; use Bugzilla::Token;
use Date::Parse; use Date::Parse;
use Time::HiRes qw(gettimeofday tv_interval);
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh; my $dbh = Bugzilla->dbh;
...@@ -792,8 +793,10 @@ $::SIG{TERM} = 'DEFAULT'; ...@@ -792,8 +793,10 @@ $::SIG{TERM} = 'DEFAULT';
$::SIG{PIPE} = 'DEFAULT'; $::SIG{PIPE} = 'DEFAULT';
# Execute the query. # Execute the query.
my $start_time = [gettimeofday()];
my $buglist_sth = $dbh->prepare($query); my $buglist_sth = $dbh->prepare($query);
$buglist_sth->execute(); $buglist_sth->execute();
$vars->{query_time} = tv_interval($start_time);
################################################################################ ################################################################################
......
...@@ -107,7 +107,7 @@ td.bz_total { ...@@ -107,7 +107,7 @@ td.bz_total {
margin-top: .25em; margin-top: .25em;
} }
.bz_query_explain { .bz_query_debug {
text-align: left; text-align: left;
} }
......
...@@ -68,10 +68,13 @@ ...@@ -68,10 +68,13 @@
</span> </span>
[% IF debug %] [% IF debug %]
<p class="bz_query">[% query FILTER html %]</p> <div class="bz_query_debug">
<p>[% query FILTER html %]</p>
<p>Execution time: [% query_time FILTER html %] seconds</p>
[% IF query_explain.defined %] [% IF query_explain.defined %]
<pre class="bz_query_explain">[% query_explain FILTER html %]</pre> <pre>[% query_explain FILTER html %]</pre>
[% END %] [% END %]
</div>
[% END %] [% END %]
[% IF user.settings.display_quips.value == 'on' %] [% IF user.settings.display_quips.value == 'on' %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment