Class: Buildkite::TestCollector::Tracer::Span
- Inherits:
-
Object
- Object
- Buildkite::TestCollector::Tracer::Span
- Defined in:
- lib/buildkite/test_collector/tracer.rb
Defined Under Namespace
Classes: IncompleteSpan
Instance Attribute Summary collapse
-
#children ⇒ Object
Returns the value of attribute children.
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#end_at ⇒ Object
Returns the value of attribute end_at.
-
#section ⇒ Object
Returns the value of attribute section.
-
#start_at ⇒ Object
Returns the value of attribute start_at.
Instance Method Summary collapse
- #as_hash ⇒ Object
- #duration ⇒ Object
-
#initialize(section, start_at, end_at, detail) ⇒ Span
constructor
A new instance of Span.
Constructor Details
#initialize(section, start_at, end_at, detail) ⇒ Span
Returns a new instance of Span.
30 31 32 33 34 35 36 |
# File 'lib/buildkite/test_collector/tracer.rb', line 30 def initialize(section, start_at, end_at, detail) @section = section @start_at = start_at @end_at = end_at @detail = detail @children = [] end |
Instance Attribute Details
#children ⇒ Object
Returns the value of attribute children.
28 29 30 |
# File 'lib/buildkite/test_collector/tracer.rb', line 28 def children @children end |
#detail ⇒ Object
Returns the value of attribute detail.
28 29 30 |
# File 'lib/buildkite/test_collector/tracer.rb', line 28 def detail @detail end |
#end_at ⇒ Object
Returns the value of attribute end_at.
28 29 30 |
# File 'lib/buildkite/test_collector/tracer.rb', line 28 def end_at @end_at end |
#section ⇒ Object
Returns the value of attribute section.
28 29 30 |
# File 'lib/buildkite/test_collector/tracer.rb', line 28 def section @section end |
#start_at ⇒ Object
Returns the value of attribute start_at.
28 29 30 |
# File 'lib/buildkite/test_collector/tracer.rb', line 28 def start_at @start_at end |
Instance Method Details
#as_hash ⇒ Object
44 45 46 47 48 49 50 51 52 53 |
# File 'lib/buildkite/test_collector/tracer.rb', line 44 def as_hash { section: section, start_at: start_at, end_at: end_at, duration: duration, detail: detail, children: children.map(&:as_hash), } end |
#duration ⇒ Object
38 39 40 41 42 |
# File 'lib/buildkite/test_collector/tracer.rb', line 38 def duration raise IncompleteSpan if end_at.nil? end_at - start_at end |