Class: ScoutApm::LayerConverterBase
- Inherits:
-
Object
- Object
- ScoutApm::LayerConverterBase
- Defined in:
- lib/scout_apm/layer_converter.rb
Direct Known Subclasses
LayerErrorConverter, LayerMetricConverter, LayerSlowTransactionConverter, RequestQueueTime
Instance Attribute Summary collapse
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#root_layer ⇒ Object
readonly
Returns the value of attribute root_layer.
-
#walker ⇒ Object
readonly
Returns the value of attribute walker.
Instance Method Summary collapse
-
#initialize(request) ⇒ LayerConverterBase
constructor
A new instance of LayerConverterBase.
-
#scope_layer ⇒ Object
Scope is determined by the first Controller we hit.
Constructor Details
#initialize(request) ⇒ LayerConverterBase
Returns a new instance of LayerConverterBase.
7 8 9 10 11 |
# File 'lib/scout_apm/layer_converter.rb', line 7 def initialize(request) @request = request @root_layer = request.root_layer @walker = LayerDepthFirstWalker.new(root_layer) end |
Instance Attribute Details
#request ⇒ Object (readonly)
Returns the value of attribute request.
4 5 6 |
# File 'lib/scout_apm/layer_converter.rb', line 4 def request @request end |
#root_layer ⇒ Object (readonly)
Returns the value of attribute root_layer.
5 6 7 |
# File 'lib/scout_apm/layer_converter.rb', line 5 def root_layer @root_layer end |
#walker ⇒ Object (readonly)
Returns the value of attribute walker.
3 4 5 |
# File 'lib/scout_apm/layer_converter.rb', line 3 def walker @walker end |
Instance Method Details
#scope_layer ⇒ Object
Scope is determined by the first Controller we hit. Most of the time there will only be 1 anyway. But if you have a controller that calls another controller method, we may pick that up:
def update
show
render :update
end
20 21 22 23 24 25 26 |
# File 'lib/scout_apm/layer_converter.rb', line 20 def scope_layer @scope_layer ||= walker.walk do |layer| if layer.type == "Controller" break layer end end end |