Module: ScoutApm::Instruments::ActionView::ActionViewTemplateRendererInstruments
- Defined in:
- lib/scout_apm/instruments/action_view.rb
Instance Method Summary collapse
-
#render_template(*args) ⇒ Object
Don’t forward kwargs here, since Rails 3, 4, 5, 6 don’t use them, and it causes annoyances in the instrumentation.
Instance Method Details
#render_template(*args) ⇒ Object
Don’t forward kwargs here, since Rails 3, 4, 5, 6 don’t use them, and it causes annoyances in the instrumentation
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 |
# File 'lib/scout_apm/instruments/action_view.rb', line 193 def render_template(*args) req = ScoutApm::RequestManager.lookup maybe_template = args[1] template_name = args[0].virtual_path rescue nil # Works on Rails 3.2 -> end of Rails 5 series template_name ||= maybe_template.virtual_path rescue nil # Works on Rails 6 -> 7.1.3 template_name ||= "Unknown" layer_name = template_name + "/Rendering" layer = ScoutApm::Layer.new("View", layer_name) layer.subscopable! begin req.start_layer(layer) super(*args) ensure req.stop_layer end end |