Class: Trace::TraceId
- Inherits:
-
Object
- Object
- Trace::TraceId
- Defined in:
- lib/finagle-thrift/trace.rb
Instance Attribute Summary collapse
-
#parent_id ⇒ Object
readonly
Returns the value of attribute parent_id.
-
#sampled ⇒ Object
(also: #sampled?)
readonly
Returns the value of attribute sampled.
-
#span_id ⇒ Object
readonly
Returns the value of attribute span_id.
-
#trace_id ⇒ Object
readonly
Returns the value of attribute trace_id.
Instance Method Summary collapse
-
#initialize(trace_id, parent_id, span_id, sampled) ⇒ TraceId
constructor
A new instance of TraceId.
- #next_id ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(trace_id, parent_id, span_id, sampled) ⇒ TraceId
Returns a new instance of TraceId.
63 64 65 66 67 68 |
# File 'lib/finagle-thrift/trace.rb', line 63 def initialize(trace_id, parent_id, span_id, sampled) @trace_id = SpanId.from_value(trace_id) @parent_id = parent_id.nil? ? nil : SpanId.from_value(parent_id) @span_id = SpanId.from_value(span_id) @sampled = !!sampled end |
Instance Attribute Details
#parent_id ⇒ Object (readonly)
Returns the value of attribute parent_id.
61 62 63 |
# File 'lib/finagle-thrift/trace.rb', line 61 def parent_id @parent_id end |
#sampled ⇒ Object (readonly) Also known as: sampled?
Returns the value of attribute sampled.
61 62 63 |
# File 'lib/finagle-thrift/trace.rb', line 61 def sampled @sampled end |
#span_id ⇒ Object (readonly)
Returns the value of attribute span_id.
61 62 63 |
# File 'lib/finagle-thrift/trace.rb', line 61 def span_id @span_id end |
#trace_id ⇒ Object (readonly)
Returns the value of attribute trace_id.
61 62 63 |
# File 'lib/finagle-thrift/trace.rb', line 61 def trace_id @trace_id end |
Instance Method Details
#next_id ⇒ Object
70 71 72 |
# File 'lib/finagle-thrift/trace.rb', line 70 def next_id TraceId.new(@trace_id, @span_id, Trace.generate_id, @sampled) end |
#to_s ⇒ Object
74 75 76 |
# File 'lib/finagle-thrift/trace.rb', line 74 def to_s "TraceId(trace_id = #{@trace_id.to_s}, parent_id = #{@parent_id.to_s}, span_id = #{@span_id.to_s}, sampled = #{@sampled.to_s})" end |