Class: Trace::Span
- Inherits:
-
Object
- Object
- Trace::Span
- Defined in:
- lib/finagle-thrift/tracer.rb
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Returns the value of attribute annotations.
-
#binary_annotations ⇒ Object
Returns the value of attribute binary_annotations.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, span_id) ⇒ Span
constructor
A new instance of Span.
- #to_thrift ⇒ Object
Constructor Details
#initialize(name, span_id) ⇒ Span
Returns a new instance of Span.
125 126 127 128 129 130 131 |
# File 'lib/finagle-thrift/tracer.rb', line 125 def initialize(name, span_id) @name = name @span_id = span_id @annotations = [] @binary_annotations = [] @debug = span_id.debug? end |
Instance Attribute Details
#annotations ⇒ Object
Returns the value of attribute annotations.
124 125 126 |
# File 'lib/finagle-thrift/tracer.rb', line 124 def annotations @annotations end |
#binary_annotations ⇒ Object
Returns the value of attribute binary_annotations.
124 125 126 |
# File 'lib/finagle-thrift/tracer.rb', line 124 def binary_annotations @binary_annotations end |
#debug ⇒ Object
Returns the value of attribute debug.
124 125 126 |
# File 'lib/finagle-thrift/tracer.rb', line 124 def debug @debug end |
#name ⇒ Object
Returns the value of attribute name.
124 125 126 |
# File 'lib/finagle-thrift/tracer.rb', line 124 def name @name end |
Instance Method Details
#to_thrift ⇒ Object
133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/finagle-thrift/tracer.rb', line 133 def to_thrift FinagleThrift::Span.new( :name => @name, :trace_id => @span_id.trace_id.to_i, :id => @span_id.span_id.to_i, :parent_id => @span_id.parent_id.nil? ? nil : @span_id.parent_id.to_i, :annotations => @annotations.map { |a| a.to_thrift }, :binary_annotations => @binary_annotations.map { |a| a.to_thrift }, :debug => @debug ) end |