class StackifyRubyAPM::Span

@api private

Constants

DEFAULT_TYPE

Attributes

context[R]
duration[R]
http_status[RW]

rubocop:enable Metrics/ParameterLists

id[R]
name[RW]

rubocop:enable Metrics/ParameterLists

original_backtrace[RW]

rubocop:enable Metrics/ParameterLists

parent_id[R]
relative_end[R]
relative_start[R]
stacktrace[R]
type[RW]

rubocop:enable Metrics/ParameterLists

Public Class Methods

new( transaction, id, name, type = nil, parent_id: nil, context: nil, http_status: nil ) click to toggle source

rubocop:disable Metrics/ParameterLists

# File lib/stackify_apm/span.rb, line 15
def initialize(
  transaction,
  id,
  name,
  type = nil,
  parent_id: nil,
  context: nil,
  http_status: nil
)
  @transaction = transaction
  @id = id
  @name = name
  @type = type || DEFAULT_TYPE
  @parent_id = parent_id
  @context = context
  @http_status = http_status
  @stacktrace = nil
  @original_backtrace = nil
end

Public Instance Methods

done() click to toggle source
# File lib/stackify_apm/span.rb, line 45
def done
  @relative_end = Time.now.to_f * 1000
  @duration = Time.now.to_f * 1000
  self.original_backtrace = nil # release it

  self
end
done?() click to toggle source
# File lib/stackify_apm/span.rb, line 53
def done?
  # !!duration
  !duration.nil?
end
inspect() click to toggle source
# File lib/stackify_apm/span.rb, line 62
def inspect
  "<StackifyRubyAPM::Span id:#{id}" \
    " name:#{name.inspect}" \
    " type:#{type.inspect}" \
    '>'
end
running?() click to toggle source
# File lib/stackify_apm/span.rb, line 58
def running?
  relative_start && !done?
end
start() click to toggle source
# File lib/stackify_apm/span.rb, line 39
def start
  @relative_start = Time.now.to_f * 1000

  self
end