summaryrefslogtreecommitdiffstats
path: root/show_bug.cgi
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-03-05 15:45:11 +0100
committerByron Jones <bjones@mozilla.com>2014-03-05 15:45:11 +0100
commit82731c84210d42bdd66c6d5e4ec80cb26a44b1ae (patch)
tree69fe2887cd9b649796c078b373a97ca4f0d10ea9 /show_bug.cgi
parent682e51ae50ca12a43b7714c53afaa40f6c4d1dc6 (diff)
downloadbugzilla-82731c84210d42bdd66c6d5e4ec80cb26a44b1ae.tar.gz
bugzilla-82731c84210d42bdd66c6d5e4ec80cb26a44b1ae.tar.xz
restore old show_bug timing code to allow for before/after comparisons
Diffstat (limited to 'show_bug.cgi')
-rwxr-xr-xshow_bug.cgi12
1 files changed, 12 insertions, 0 deletions
diff --git a/show_bug.cgi b/show_bug.cgi
index c87ef1601..99679f7ad 100755
--- a/show_bug.cgi
+++ b/show_bug.cgi
@@ -30,12 +30,16 @@ use Bugzilla::Error;
use Bugzilla::User;
use Bugzilla::Keyword;
use Bugzilla::Bug;
+use Bugzilla::Instrument;
+
+my $timings = Bugzilla::Instrument->new('show_bug');
my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template;
my $vars = {};
my $user = Bugzilla->login();
+$timings->time('login_time');
my $format = $template->get_format("bug/show", scalar $cgi->param('format'),
scalar $cgi->param('ctype'));
@@ -89,8 +93,10 @@ if ($single) {
}
}
}
+$timings->time('load_bug_time');
Bugzilla::Bug->preload(\@bugs);
+$timings->time('preload_time');
$vars->{'bugs'} = \@bugs;
$vars->{'marks'} = \%marks;
@@ -128,4 +134,10 @@ print $cgi->header($format->{'ctype'});
$template->process($format->{'template'}, $vars)
|| ThrowTemplateError($template->error());
+$timings->time('template_time');
+if (scalar(@bugids) == 1) {
+ $timings->label('bug-' . $bugs[0]->id);
+ $timings->label('user-' . $user->id);
+ $timings->log();
+}