summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2012-03-22 07:18:18 +0100
committerByron Jones <bjones@mozilla.com>2012-03-22 07:18:18 +0100
commit399f0b45f6fb796941b92ed2899fcc17e3ab0ea9 (patch)
treeedbcf9a735086d581897b7ac7a8d30f825e7bfe7
parent8e28c08bc098913884b413e9989f3ec8a4a35bf9 (diff)
downloadbugzilla-399f0b45f6fb796941b92ed2899fcc17e3ab0ea9.tar.gz
bugzilla-399f0b45f6fb796941b92ed2899fcc17e3ab0ea9.tar.xz
Bug 732440: add sql timings to buglist.cgi's debug output
-rwxr-xr-xbuglist.cgi3
-rw-r--r--skins/standard/buglist.css2
-rw-r--r--template/en/default/list/list.html.tmpl11
3 files changed, 11 insertions, 5 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 7b513e607..d2f9a6904 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -51,6 +51,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;
@@ -830,8 +831,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);
################################################################################
diff --git a/skins/standard/buglist.css b/skins/standard/buglist.css
index ebebfb3ef..a86009def 100644
--- a/skins/standard/buglist.css
+++ b/skins/standard/buglist.css
@@ -119,7 +119,7 @@ td.bz_total {
margin-top: .25em;
}
-.bz_query_explain {
+.bz_query_debug {
text-align: left;
}
diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl
index ccf3427dd..a21117d34 100644
--- a/template/en/default/list/list.html.tmpl
+++ b/template/en/default/list/list.html.tmpl
@@ -59,10 +59,13 @@
</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' %]