From 6af883e17f343b8db399befba0cbec21f4f0cee3 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 22 Mar 2012 14:15:12 +0800 Subject: Bug 732440: Add SQL execution timings to buglist.cgi's debug output r=LpSolit, r=LpSolit --- buglist.cgi | 3 +++ skins/standard/buglist.css | 2 +- template/en/default/list/list.html.tmpl | 11 +++++++---- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/buglist.cgi b/buglist.cgi index 98b10a75d..3e7aadf2c 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -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); ################################################################################ diff --git a/skins/standard/buglist.css b/skins/standard/buglist.css index 010cd11e8..b4920c609 100644 --- a/skins/standard/buglist.css +++ b/skins/standard/buglist.css @@ -107,7 +107,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 f6a688c5f..6c600c6fa 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -68,10 +68,13 @@ [% IF debug %] -

[% query FILTER html %]

- [% IF query_explain.defined %] -
[% query_explain FILTER html %]
- [% END %] +
+

[% query FILTER html %]

+

Execution time: [% query_time FILTER html %] seconds

+ [% IF query_explain.defined %] +
[% query_explain FILTER html %]
+ [% END %] +
[% END %] [% IF user.settings.display_quips.value == 'on' %] -- cgit v1.2.3-24-g4f1b