aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r--actionpack/lib/action_view/template.rb8
-rw-r--r--actionpack/lib/action_view/test_case.rb1
2 files changed, 7 insertions, 2 deletions
diff --git a/actionpack/lib/action_view/template.rb b/actionpack/lib/action_view/template.rb
index 6315e502dd..ad37eb4c4a 100644
--- a/actionpack/lib/action_view/template.rb
+++ b/actionpack/lib/action_view/template.rb
@@ -36,8 +36,12 @@ module ActionView
end
def render(view, locals, &block)
- method_name = compile(locals, view)
- view.send(method_name, locals, &block)
+ # TODO: Revisit this name
+ # This is only slow if it's being listened to. Do not instrument this in production.
+ ActiveSupport::Notifications.instrument("action_view.slow_render_template", :virtual_path => @virtual_path) do
+ method_name = compile(locals, view)
+ view.send(method_name, locals, &block)
+ end
rescue Exception => e
if e.is_a?(Template::Error)
e.sub_template_of(self)
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb
index 7e609eb640..8750a501b7 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionpack/lib/action_view/test_case.rb
@@ -42,6 +42,7 @@ module ActionView
end
include ActionDispatch::Assertions, ActionDispatch::TestProcess
+ include ActionController::TemplateAssertions
include ActionView::Context
include ActionController::PolymorphicRoutes