Module: ScoutApm::Instruments::ActionView::ActionViewPartialRendererInstruments
- Defined in:
- lib/scout_apm/instruments/action_view.rb
Instance Method Summary collapse
- #collection_with_template(*args, **kwargs) ⇒ Object
-
#render_partial(*args, **kwargs) ⇒ Object
In Rails 6, the signature changed to pass the view & template args directly, as opposed to through the instance var New signature is: def render_partial(view, template).
Instance Method Details
#collection_with_template(*args, **kwargs) ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/scout_apm/instruments/action_view.rb', line 105 def collection_with_template(*args, **kwargs) req = ScoutApm::RequestManager.lookup template_name = @template.virtual_path rescue "Unknown Collection" template_name ||= "Unknown Collection" layer_name = template_name + "/Rendering" layer = ScoutApm::Layer.new("View", layer_name) layer.subscopable! begin req.start_layer(layer) if ScoutApm::Agent.instance.context.environment.supports_kwarg_delegation? super(*args, **kwargs) else super(*args) end ensure req.stop_layer end end |
#render_partial(*args, **kwargs) ⇒ Object
In Rails 6, the signature changed to pass the view & template args directly, as opposed to through the instance var New signature is: def render_partial(view, template)
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/scout_apm/instruments/action_view.rb', line 80 def render_partial(*args, **kwargs) req = ScoutApm::RequestManager.lookup maybe_template = args[1] template_name = @template.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 -> 6.0.3 template_name ||= "Unknown Partial" layer_name = template_name + "/Rendering" layer = ScoutApm::Layer.new("View", layer_name) layer.subscopable! begin req.start_layer(layer) if ScoutApm::Agent.instance.context.environment.supports_kwarg_delegation? super(*args, **kwargs) else super(*args) end ensure req.stop_layer end end |