Class: Skywalking::Tracing::Segment
- Inherits:
-
Object
- Object
- Skywalking::Tracing::Segment
- Defined in:
- lib/skywalking/tracing/segment.rb
Instance Attribute Summary collapse
-
#related_traces ⇒ Object
Returns the value of attribute related_traces.
-
#segment_id ⇒ Object
Returns the value of attribute segment_id.
-
#spans ⇒ Object
Returns the value of attribute spans.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
- #archive(span) ⇒ Object
-
#initialize ⇒ Segment
constructor
A new instance of Segment.
- #relate(trace_id) ⇒ Object
Constructor Details
#initialize ⇒ Segment
23 24 25 26 27 28 |
# File 'lib/skywalking/tracing/segment.rb', line 23 def initialize @segment_id = Utils::IDGen.new @spans = [] = (Process.clock_gettime(Process::CLOCK_REALTIME) * 1000).to_i = [Utils::IDGen.new] end |
Instance Attribute Details
#related_traces ⇒ Object
Returns the value of attribute related_traces.
21 22 23 |
# File 'lib/skywalking/tracing/segment.rb', line 21 def end |
#segment_id ⇒ Object
Returns the value of attribute segment_id.
21 22 23 |
# File 'lib/skywalking/tracing/segment.rb', line 21 def segment_id @segment_id end |
#spans ⇒ Object
Returns the value of attribute spans.
21 22 23 |
# File 'lib/skywalking/tracing/segment.rb', line 21 def spans @spans end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
21 22 23 |
# File 'lib/skywalking/tracing/segment.rb', line 21 def end |
Instance Method Details
#archive(span) ⇒ Object
30 31 32 |
# File 'lib/skywalking/tracing/segment.rb', line 30 def archive(span) @spans << span end |
#relate(trace_id) ⇒ Object
34 35 36 37 |
# File 'lib/skywalking/tracing/segment.rb', line 34 def relate(trace_id) .pop if [0].is_a?(Utils::IDGen) << trace_id end |