Class: Datadog::Profiling::BacktraceLocation

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



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

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.



7
8
9
# File 'lib/ddtrace/profiling/backtrace_location.rb', line 7

def base_label
  @base_label
end

#hashObject (readonly)

Returns the value of attribute hash.



7
8
9
# File 'lib/ddtrace/profiling/backtrace_location.rb', line 7

def hash
  @hash
end

#linenoObject (readonly)

Returns the value of attribute lineno.



7
8
9
# File 'lib/ddtrace/profiling/backtrace_location.rb', line 7

def lineno
  @lineno
end

#pathObject (readonly)

Returns the value of attribute path.



7
8
9
# File 'lib/ddtrace/profiling/backtrace_location.rb', line 7

def path
  @path
end

Instance Method Details

#==(other) ⇒ Object



24
25
26
# File 'lib/ddtrace/profiling/backtrace_location.rb', line 24

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ddtrace/profiling/backtrace_location.rb', line 28

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