class OneApm::Agent::Threading::BacktraceNode
Attributes
as_array[R]
depth[RW]
file[R]
line_no[R]
method[R]
raw_line[R]
runnable_count[RW]
Public Class Methods
new(line)
click to toggle source
Calls superclass method
OneApm::Agent::Threading::BacktraceBase::new
# File lib/one_apm/support/backtrace/backtrace_node.rb, line 84 def initialize(line) super() @raw_line = line @children = [] @runnable_count = 0 end
Public Instance Methods
==(other)
click to toggle source
# File lib/one_apm/support/backtrace/backtrace_node.rb, line 91 def ==(other) ( @raw_line == other.raw_line && @depth == other.depth && @runnable_count == other.runnable_count ) end
complete_array_conversion()
click to toggle source
# File lib/one_apm/support/backtrace/backtrace_node.rb, line 105 def complete_array_conversion child_arrays = @children.map { |c| c.as_array }.compact file, method, line = parse_backtrace_frame(@raw_line) @as_array << [string(file), string(method), line ? int(line) : OA_UNKNOWN_LINE_NUMBER] @as_array << int(@runnable_count) @as_array << 0 @as_array << child_arrays end
dump_string(indent=0)
click to toggle source
# File lib/one_apm/support/backtrace/backtrace_node.rb, line 116 def dump_string(indent=0) @file, @method, @line_no = parse_backtrace_frame(@raw_line) result = "#{" " * indent}#<BacktraceNode:#{object_id} [#{@runnable_count}] #{@file}:#{@line_no} in #{@method}>" child_results = @children.map { |c| c.dump_string(indent+2) }.join("\n") result << "\n" unless child_results.empty? result << child_results end
mark_for_array_conversion()
click to toggle source
# File lib/one_apm/support/backtrace/backtrace_node.rb, line 99 def mark_for_array_conversion @as_array = [] end
parse_backtrace_frame(frame)
click to toggle source
Returns [filename, method, line number]
# File lib/one_apm/support/backtrace/backtrace_node.rb, line 125 def parse_backtrace_frame(frame) frame =~ /([^:]*)(\:(\d+))?\:in `(.*)'/ [$1, $4, $3] # sic end