Module: ScoutApm::Instruments::ActionView::ActionViewPartialRendererInstruments

Defined in:
lib/scout_apm/instruments/action_view.rb

Instance Method Summary collapse

Instance Method Details

#collection_with_template(*args) ⇒ Object



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/scout_apm/instruments/action_view.rb', line 96

def collection_with_template(*args)
  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)
    super(*args)
  ensure
    req.stop_layer
  end
end

#render_partial(*args) ⇒ Object



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/scout_apm/instruments/action_view.rb', line 78

def render_partial(*args)
  req = ScoutApm::RequestManager.lookup

  template_name = @template.virtual_path rescue "Unknown Partial"
  template_name ||= "Unknown Partial"
  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