Class: Sixty::Tracer::Span
- Inherits:
-
Object
- Object
- Sixty::Tracer::Span
- 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
-
#attrs ⇒ Object
Returns the value of attribute attrs.
-
#child_duration ⇒ Object
Returns the value of attribute child_duration.
-
#children ⇒ Object
Returns the value of attribute children.
-
#db_calls ⇒ Object
Returns the value of attribute db_calls.
-
#db_rows ⇒ Object
Returns the value of attribute db_rows.
-
#depth ⇒ Object
Returns the value of attribute depth.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#error ⇒ Object
Returns the value of attribute error.
-
#id ⇒ Object
Returns the value of attribute id.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#recording ⇒ Object
Returns the value of attribute recording.
-
#root ⇒ Object
Returns the value of attribute root.
-
#span_count ⇒ Object
Returns the value of attribute span_count.
-
#start ⇒ Object
Returns the value of attribute start.
-
#start_wall ⇒ Object
Returns the value of attribute start_wall.
-
#trace_id ⇒ Object
Returns the value of attribute trace_id.
-
#truncated ⇒ Object
Returns the value of attribute truncated.
Instance Method Summary collapse
-
#initialize(kind, name, attrs, parent) ⇒ Span
constructor
A new instance of Span.
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
#attrs ⇒ Object
Returns the value of attribute attrs.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def attrs @attrs end |
#child_duration ⇒ Object
Returns the value of attribute child_duration.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def child_duration @child_duration end |
#children ⇒ Object
Returns the value of attribute children.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def children @children end |
#db_calls ⇒ Object
Returns the value of attribute db_calls.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def db_calls @db_calls end |
#db_rows ⇒ Object
Returns the value of attribute db_rows.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def db_rows @db_rows end |
#depth ⇒ Object
Returns the value of attribute depth.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def depth @depth end |
#duration ⇒ Object
Returns the value of attribute duration.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def duration @duration end |
#error ⇒ Object
Returns the value of attribute error.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def error @error end |
#id ⇒ Object
Returns the value of attribute id.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def id @id end |
#kind ⇒ Object
Returns the value of attribute kind.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def kind @kind end |
#name ⇒ Object
Returns the value of attribute name.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def parent @parent end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def parent_id @parent_id end |
#recording ⇒ Object
Returns the value of attribute recording.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def recording @recording end |
#root ⇒ Object
Returns the value of attribute root.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def root @root end |
#span_count ⇒ Object
Returns the value of attribute span_count.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def span_count @span_count end |
#start ⇒ Object
Returns the value of attribute start.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def start @start end |
#start_wall ⇒ Object
Returns the value of attribute start_wall.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def start_wall @start_wall end |
#trace_id ⇒ Object
Returns the value of attribute trace_id.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def trace_id @trace_id end |
#truncated ⇒ Object
Returns the value of attribute truncated.
52 53 54 |
# File 'lib/sixty/tracer.rb', line 52 def truncated @truncated end |