Class: Datadog::Profiling::BacktraceLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/profiling/backtrace_location.rb

Overview

Entity class used to represent an entry in a stack trace. Its fields are a simplified struct version of ‘Thread::Backtrace::Location`.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_label, lineno, path) ⇒ BacktraceLocation

Returns a new instance of BacktraceLocation.



12
13
14
15
16
17
18
19
20
21
# File 'lib/datadog/profiling/backtrace_location.rb', line 12

def initialize(
  base_label,
  lineno,
  path
)
  @base_label = base_label
  @lineno = lineno
  @path = path
  @hash = [base_label, lineno, path].hash
end

Instance Attribute Details

#base_labelObject (readonly)

Returns the value of attribute base_label.



6
7
8
# File 'lib/datadog/profiling/backtrace_location.rb', line 6

def base_label
  @base_label
end

#hashObject (readonly)

Returns the value of attribute hash.



6
7
8
# File 'lib/datadog/profiling/backtrace_location.rb', line 6

def hash
  @hash
end

#linenoObject (readonly)

Returns the value of attribute lineno.



6
7
8
# File 'lib/datadog/profiling/backtrace_location.rb', line 6

def lineno
  @lineno
end

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/datadog/profiling/backtrace_location.rb', line 6

def path
  @path
end

Instance Method Details

#==(other) ⇒ Object



23
24
25
# File 'lib/datadog/profiling/backtrace_location.rb', line 23

def ==(other)
  hash == other.hash
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/datadog/profiling/backtrace_location.rb', line 27

def eql?(other)
  hash == other.hash
end