Class: Datadog::Profiling::Events::Stack

Inherits:
Datadog::Profiling::Event show all
Defined in:
lib/datadog/profiling/events/stack.rb

Overview

Describes a stack profiling event

Direct Known Subclasses

StackSample

Instance Attribute Summary collapse

Attributes inherited from Datadog::Profiling::Event

#timestamp

Instance Method Summary collapse

Constructor Details

#initialize(timestamp, frames, total_frame_count, thread_id, root_span_id, span_id, trace_resource) ⇒ Stack

Returns a new instance of Stack.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/datadog/profiling/events/stack.rb', line 19

def initialize(
  timestamp,
  frames,
  total_frame_count,
  thread_id,
  root_span_id,
  span_id,
  trace_resource
)
  super(timestamp)

  @frames = frames
  @total_frame_count = total_frame_count
  @thread_id = thread_id
  @root_span_id = root_span_id
  @span_id = span_id
  @trace_resource = trace_resource

  @hash = [
    thread_id,
    root_span_id,
    span_id,
    # trace_resource is deliberately not included -- events that share the same (root_span_id, span_id) refer
    # to the same trace
    frames.collect(&:hash),
    total_frame_count
  ].hash
end

Instance Attribute Details

#framesObject (readonly)

Returns the value of attribute frames.



10
11
12
# File 'lib/datadog/profiling/events/stack.rb', line 10

def frames
  @frames
end

#hashObject (readonly)

Returns the value of attribute hash.



10
11
12
# File 'lib/datadog/profiling/events/stack.rb', line 10

def hash
  @hash
end

#root_span_idObject (readonly)

Returns the value of attribute root_span_id.



10
11
12
# File 'lib/datadog/profiling/events/stack.rb', line 10

def root_span_id
  @root_span_id
end

#span_idObject (readonly)

Returns the value of attribute span_id.



10
11
12
# File 'lib/datadog/profiling/events/stack.rb', line 10

def span_id
  @span_id
end

#thread_idObject (readonly)

Returns the value of attribute thread_id.



10
11
12
# File 'lib/datadog/profiling/events/stack.rb', line 10

def thread_id
  @thread_id
end

#total_frame_countObject (readonly)

Returns the value of attribute total_frame_count.



10
11
12
# File 'lib/datadog/profiling/events/stack.rb', line 10

def total_frame_count
  @total_frame_count
end

#trace_resourceObject (readonly)

Returns the value of attribute trace_resource.



10
11
12
# File 'lib/datadog/profiling/events/stack.rb', line 10

def trace_resource
  @trace_resource
end