Class: Sixty::Tracer::Span

Inherits:
Object
  • Object
show all
Defined in:
lib/sixty/tracer.rb

Overview

A plain class rather than a keyword-initialized Struct, and that is a measured decision: this object is allocated on every instrumented call in the application, and building it from a keyword hash costs several microseconds per span — enough to show up in a benchmark of a method that does nothing. Assigning ivars directly is the cheapest thing Ruby offers.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, name, attrs, parent) ⇒ Span

Returns a new instance of Span.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/sixty/tracer.rb', line 57

def initialize(kind, name, attrs, parent)
  @kind = kind
  @name = name
  @attrs = attrs
  @parent = parent
  @duration = nil
  @child_duration = 0.0
  @db_calls = 0
  @db_rows = 0
  @error = nil
  @children = []
  @span_count = 0
  @truncated = false
  @recording = false
end

Instance Attribute Details

#attrsObject

Returns the value of attribute attrs.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def attrs
  @attrs
end

#child_durationObject

Returns the value of attribute child_duration.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def child_duration
  @child_duration
end

#childrenObject

Returns the value of attribute children.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def children
  @children
end

#db_callsObject

Returns the value of attribute db_calls.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def db_calls
  @db_calls
end

#db_rowsObject

Returns the value of attribute db_rows.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def db_rows
  @db_rows
end

#depthObject

Returns the value of attribute depth.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def depth
  @depth
end

#durationObject

Returns the value of attribute duration.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def duration
  @duration
end

#errorObject

Returns the value of attribute error.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def error
  @error
end

#idObject

Returns the value of attribute id.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def id
  @id
end

#kindObject

Returns the value of attribute kind.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def kind
  @kind
end

#nameObject

Returns the value of attribute name.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def name
  @name
end

#parentObject

Returns the value of attribute parent.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def parent
  @parent
end

#parent_idObject

Returns the value of attribute parent_id.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def parent_id
  @parent_id
end

#recordingObject

Returns the value of attribute recording.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def recording
  @recording
end

#rootObject

Returns the value of attribute root.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def root
  @root
end

#span_countObject

Returns the value of attribute span_count.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def span_count
  @span_count
end

#startObject

Returns the value of attribute start.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def start
  @start
end

#start_wallObject

Returns the value of attribute start_wall.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def start_wall
  @start_wall
end

#trace_idObject

Returns the value of attribute trace_id.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def trace_id
  @trace_id
end

#truncatedObject

Returns the value of attribute truncated.



52
53
54
# File 'lib/sixty/tracer.rb', line 52

def truncated
  @truncated
end