aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view
diff options
context:
space:
mode:
authorCarlhuda <carlhuda@engineyard.com>2010-03-17 14:19:42 -0700
committerCarlhuda <carlhuda@engineyard.com>2010-03-17 14:29:18 -0700
commit947f86c699b33bd44703b3554db58e4cfca37c86 (patch)
tree8029a2acf7180b2724830e2727c37252872e436e /actionpack/lib/action_view
parent13a783672aad338b9c7ade5319ec7967768905d7 (diff)
downloadrails-947f86c699b33bd44703b3554db58e4cfca37c86.tar.gz
rails-947f86c699b33bd44703b3554db58e4cfca37c86.tar.bz2
rails-947f86c699b33bd44703b3554db58e4cfca37c86.zip
Modify assert_template to use instrumentation
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