class Mmtrix::Agent::Threading::BacktraceRoot
Attributes
flattened[R]
Public Class Methods
new()
click to toggle source
Calls superclass method
Mmtrix::Agent::Threading::BacktraceBase::new
# File lib/mmtrix/agent/threading/backtrace_node.rb, line 38 def initialize super @flattened = [] end
Public Instance Methods
==(other)
click to toggle source
# File lib/mmtrix/agent/threading/backtrace_node.rb, line 43 def ==(other) true # all roots are at the same depth and have no raw_line end
aggregate(backtrace)
click to toggle source
# File lib/mmtrix/agent/threading/backtrace_node.rb, line 51 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
as_array()
click to toggle source
# File lib/mmtrix/agent/threading/backtrace_node.rb, line 47 def as_array @children.map { |c| c.as_array }.compact end
dump_string()
click to toggle source
# File lib/mmtrix/agent/threading/backtrace_node.rb, line 73 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