]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 732440: Add SQL execution timings to buglist.cgi's debug output
authorByron Jones <bjones@mozilla.com>
Thu, 22 Mar 2012 06:15:12 +0000 (14:15 +0800)
committerByron Jones <bjones@mozilla.com>
Thu, 22 Mar 2012 06:15:12 +0000 (14:15 +0800)
r=LpSolit, r=LpSolit

buglist.cgi
skins/standard/buglist.css
template/en/default/list/list.html.tmpl

index 98b10a75d20baec299d92b22a3b5639f08a5b907..3e7aadf2c9af4e63fa9bc34209b00445339c900f 100755 (executable)
@@ -32,6 +32,7 @@ use Bugzilla::Status;
 use Bugzilla::Token;
 
 use Date::Parse;
+use Time::HiRes qw(gettimeofday tv_interval);
 
 my $cgi = Bugzilla->cgi;
 my $dbh = Bugzilla->dbh;
@@ -792,8 +793,10 @@ $::SIG{TERM} = 'DEFAULT';
 $::SIG{PIPE} = 'DEFAULT';
 
 # Execute the query.
+my $start_time = [gettimeofday()];
 my $buglist_sth = $dbh->prepare($query);
 $buglist_sth->execute();
+$vars->{query_time} = tv_interval($start_time);
 
 
 ################################################################################
index 010cd11e81b820959bae47133df3ba01e51b3dcb..b4920c60925607926919bb50d6edbe2e73fc8804 100644 (file)
@@ -107,7 +107,7 @@ td.bz_total {
   margin-top: .25em;
 }
 
-.bz_query_explain {
+.bz_query_debug {
     text-align: left;
 }
 
index f6a688c5f3eff867d396581eaeb5a6779a9140c6..6c600c6fa86721b1dc25baa4c03d23e9fac74d78 100644 (file)
   </span>
 
   [% IF debug %]
-    <p class="bz_query">[% query FILTER html %]</p>
-    [% IF query_explain.defined %]
-      <pre class="bz_query_explain">[% query_explain FILTER html %]</pre>
-    [% END %]
+    <div class="bz_query_debug">
+      <p>[% query FILTER html %]</p>
+      <p>Execution time: [% query_time FILTER html %] seconds</p>
+      [% IF query_explain.defined %]
+        <pre>[% query_explain FILTER html %]</pre>
+      [% END %]
+    </div>
   [% END %]
 
   [% IF user.settings.display_quips.value == 'on' %]