summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2014-03-04 09:38:49 +0100
committerByron Jones <bjones@mozilla.com>2014-03-04 09:38:49 +0100
commitfaf2fc5dbead69f0de0df51af85561f1203dee45 (patch)
tree7e323a20361165348a3f8a564c9e1d22df820a1c /Bugzilla/Template.pm
parent9193214274889f2b7636146e72d8200e9bfaeb7b (diff)
downloadbugzilla-faf2fc5dbead69f0de0df51af85561f1203dee45.tar.gz
bugzilla-faf2fc5dbead69f0de0df51af85561f1203dee45.tar.xz
Bug 956230: improve instrumentation of bugzilla's internals
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index bf1254626..fdeda165c 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -982,7 +982,10 @@ sub create {
$shared_providers->{$provider_key} ||= Template::Provider->new($config);
$config->{LOAD_TEMPLATES} = [ $shared_providers->{$provider_key} ];
- local $Template::Config::CONTEXT = 'Bugzilla::Template::Context';
+ # BMO - use metrics subclass
+ local $Template::Config::CONTEXT = Bugzilla->metrics_enabled()
+ ? 'Bugzilla::Metrics::Template::Context'
+ : 'Bugzilla::Template::Context';
Bugzilla::Hook::process('template_before_create', { config => $config });
my $template = $class->new($config)