class NewRelic::Agent::Threading::BacktraceRoot
Attributes
Public Class Methods
Source
# File lib/new_relic/agent/threading/backtrace_node.rb, line 37 def initialize super @flattened = [] end
Calls superclass method
NewRelic::Agent::Threading::BacktraceBase::new
Public Instance Methods
Source
# File lib/new_relic/agent/threading/backtrace_node.rb, line 42 def ==(other) true # all roots are at the same depth and have no raw_line end
Source
# File lib/new_relic/agent/threading/backtrace_node.rb, line 50 def aggregate(backtrace) current = self depth = 0 backtrace.reverse_each do |frame| break if depth >= MAX_THREAD_PROFILE_DEPTH existing_node = current.find_child(frame) if existing_node node = existing_node else node = Threading::BacktraceNode.new(frame) current.add_child(node) @flattened << node end node.runnable_count += 1 current = node depth += 1 end end
Source
# File lib/new_relic/agent/threading/backtrace_node.rb, line 46 def as_array @children.map { |c| c.as_array }.compact end
Source
# File lib/new_relic/agent/threading/backtrace_node.rb, line 72 def dump_string result = +"#<BacktraceRoot:#{object_id}>" child_results = @children.map { |c| c.dump_string(2) }.join("\n") result << "\n" unless child_results.empty? result << child_results end