class Buildkite::TestCollector::Tracer::Span

def as_hash

def as_hash
  {
    section: section,
    start_at: start_at,
    end_at: end_at,
    duration: duration,
    detail: detail,
    children: children.map(&:as_hash),
  }
end

def duration

def duration
  raise IncompleteSpan if end_at.nil?
  end_at - start_at
end

def initialize(section, start_at, end_at, detail)

def initialize(section, start_at, end_at, detail)
  @section = section
  @start_at = start_at
  @end_at = end_at
  @detail = detail
  @children = []
end