Class: OneApm::Agent::Threading::BacktraceBase

Inherits:
Object
  • Object
show all
Defined in:
lib/one_apm/support/backtrace/backtrace_node.rb

Direct Known Subclasses

BacktraceNode, BacktraceRoot

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBacktraceBase

Returns a new instance of BacktraceBase.



12
13
14
15
# File 'lib/one_apm/support/backtrace/backtrace_node.rb', line 12

def initialize
  @children = []
  @depth    = 0
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



10
11
12
# File 'lib/one_apm/support/backtrace/backtrace_node.rb', line 10

def children
  @children
end

Instance Method Details

#add_child(child) ⇒ Object



22
23
24
25
# File 'lib/one_apm/support/backtrace/backtrace_node.rb', line 22

def add_child(child)
  child.depth = @depth + 1
  @children << child
end

#add_child_unless_present(child) ⇒ Object



17
18
19
20
# File 'lib/one_apm/support/backtrace/backtrace_node.rb', line 17

def add_child_unless_present(child)
  child.depth = @depth + 1
  @children << child unless @children.include? child
end

#find_child(raw_line) ⇒ Object



27
28
29
# File 'lib/one_apm/support/backtrace/backtrace_node.rb', line 27

def find_child(raw_line)
  @children.find { |child| child.raw_line == raw_line }
end