Class: RSpec::Buildkite::Analytics::Tracer::Span

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/buildkite/analytics/tracer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(section, start_at, end_at, detail) ⇒ Span

Returns a new instance of Span.



10
11
12
13
14
15
16
# File 'lib/rspec/buildkite/analytics/tracer.rb', line 10

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

#childrenObject

Returns the value of attribute children.



8
9
10
# File 'lib/rspec/buildkite/analytics/tracer.rb', line 8

def children
  @children
end

#detailObject

Returns the value of attribute detail.



8
9
10
# File 'lib/rspec/buildkite/analytics/tracer.rb', line 8

def detail
  @detail
end

#end_atObject

Returns the value of attribute end_at.



8
9
10
# File 'lib/rspec/buildkite/analytics/tracer.rb', line 8

def end_at
  @end_at
end

#sectionObject

Returns the value of attribute section.



8
9
10
# File 'lib/rspec/buildkite/analytics/tracer.rb', line 8

def section
  @section
end

#start_atObject

Returns the value of attribute start_at.



8
9
10
# File 'lib/rspec/buildkite/analytics/tracer.rb', line 8

def start_at
  @start_at
end

Instance Method Details

#as_hashObject



18
19
20
21
22
23
24
25
26
27
# File 'lib/rspec/buildkite/analytics/tracer.rb', line 18

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