From faf2fc5dbead69f0de0df51af85561f1203dee45 Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 4 Mar 2014 16:38:49 +0800 Subject: Bug 956230: improve instrumentation of bugzilla's internals --- Bugzilla/Template.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Bugzilla/Template.pm') 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) -- cgit v1.2.3-24-g4f1b