class ScoutApm::LimitedLayer
A LimitedLayer
is a lossy-compression approach to fall back on once we max out the number of detailed layer objects we store. See LayerChildrenSet
for the logic on when that change over happens
QUESTION: What do we do if we attempt to merge an item that has children?
Attributes
Public Class Methods
Source
# File lib/scout_apm/limited_layer.rb, line 10 def initialize(type) @type = type @total_call_time = 0 @total_exclusive_time = 0 @total_allocations = 0 @total_exclusive_allocations = 0 @total_layers = 0 end
Public Instance Methods
Source
# File lib/scout_apm/limited_layer.rb, line 20 def absorb(layer) @total_layers += 1 @total_call_time += layer.total_call_time @total_exclusive_time += layer.total_exclusive_time @total_allocations += layer.total_allocations @total_exclusive_allocations += layer.total_exclusive_allocations end
Source
# File lib/scout_apm/limited_layer.rb, line 94 def add_child raise "Should never call add_child on a limited_layer" end
Many methods don’t make any sense on a limited layer. Raise errors # aggressively for now to detect mistaken calls #
Source
# File lib/scout_apm/limited_layer.rb, line 110 def annotate_layer(*) raise "Should never call annotate_layer on a limited_layer" end
Source
# File lib/scout_apm/limited_layer.rb, line 122 def caller_array raise "Should never call caller_array on a limited_layer" end
Source
# File lib/scout_apm/limited_layer.rb, line 118 def capture_backtrace! raise "Should never call capture_backtrace on a limited_layer" end
Source
# File lib/scout_apm/limited_layer.rb, line 106 def desc=(*) raise "Should never call desc on a limited_layer" end
Source
# File lib/scout_apm/limited_layer.rb, line 53 def legacy_metric_name "#{type}/Limited" end
This is the old style name. This function is used for now, but should be removed, and the new type & name split should be enforced through the app.
Source
# File lib/scout_apm/limited_layer.rb, line 102 def record_allocations! raise "Should never call record_allocations! on a limited_layer" end
Source
# File lib/scout_apm/limited_layer.rb, line 98 def record_stop_time!(*) raise "Should never call record_stop_time! on a limited_layer" end
Source
# File lib/scout_apm/limited_layer.rb, line 114 def subscopable! raise "Should never call subscopable! on a limited_layer" end
Source
# File lib/scout_apm/limited_layer.rb, line 76 def subscopable? false end
Stub out some methods with static default values #
Source
# File lib/scout_apm/limited_layer.rb, line 65 def to_s "<LimitedLayer type=#{type} count=#{count}>" end
Source
# File lib/scout_apm/limited_layer.rb, line 38 def total_allocations @total_allocations end
Source
# File lib/scout_apm/limited_layer.rb, line 30 def total_call_time @total_call_time end
Source
# File lib/scout_apm/limited_layer.rb, line 42 def total_exclusive_allocations @total_exclusive_allocations end
Source
# File lib/scout_apm/limited_layer.rb, line 34 def total_exclusive_time @total_exclusive_time end