Class: NewRelic::Agent::Threading::BacktraceBase

Inherits:
Object
  • Object
show all
Defined in:
lib/new_relic/agent/threading/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.



14
15
16
17
# File 'lib/new_relic/agent/threading/backtrace_node.rb', line 14

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

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



12
13
14
# File 'lib/new_relic/agent/threading/backtrace_node.rb', line 12

def children
  @children
end

Instance Method Details

#add_child(child) ⇒ Object



24
25
26
27
# File 'lib/new_relic/agent/threading/backtrace_node.rb', line 24

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

#add_child_unless_present(child) ⇒ Object



19
20
21
22
# File 'lib/new_relic/agent/threading/backtrace_node.rb', line 19

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

#find_child(raw_line) ⇒ Object



29
30
31
# File 'lib/new_relic/agent/threading/backtrace_node.rb', line 29

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