Class: Timify::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/timify/span.rb

Overview

A segment that crossed an #on_slow or #on_share threshold.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, label:, location:, secs:, inclusive:, share: nil, parent_label: nil) ⇒ Event

Returns a new instance of Event.

Parameters:

  • name (Object)
  • label (String, nil)
  • location (String)
  • secs (Float)
  • inclusive (Float)
  • share (Float, nil) (defaults to: nil)
  • parent_label (String, nil) (defaults to: nil)


61
62
63
64
65
66
67
68
69
# File 'lib/timify/span.rb', line 61

def initialize(name:, label:, location:, secs:, inclusive:, share: nil, parent_label: nil)
  @name = name
  @label = label
  @location = location
  @secs = secs
  @inclusive = inclusive
  @share = share
  @parent_label = parent_label
end

Instance Attribute Details

#inclusive ⇒ Float (readonly)

Returns inclusive time of the segment.

Returns:

  • (Float) —

    inclusive time of the segment



44
45
46
# File 'lib/timify/span.rb', line 44

def inclusive
  @inclusive
end

#label ⇒ String? (readonly)

Returns:

  • (String, nil)


35
36
37
# File 'lib/timify/span.rb', line 35

def label
  @label
end

#location ⇒ String (readonly)

Returns:

  • (String)


38
39
40
# File 'lib/timify/span.rb', line 38

def location
  @location
end

#name ⇒ Object (readonly)

Returns:

  • (Object)


32
33
34
# File 'lib/timify/span.rb', line 32

def name
  @name
end

#parent_label ⇒ String? (readonly)

Returns label of the parent span; set for Timify#on_share events, nil for Timify#on_slow.

Returns:



52
53
54
# File 'lib/timify/span.rb', line 52

def parent_label
  @parent_label
end

#secs ⇒ Float (readonly)

Returns self time of the segment.

Returns:

  • (Float) —

    self time of the segment



41
42
43
# File 'lib/timify/span.rb', line 41

def secs
  @secs
end

#share ⇒ Float? (readonly)

Returns child inclusive / parent elapsed so far; set for Timify#on_share events, nil for Timify#on_slow.

Returns:



48
49
50
# File 'lib/timify/span.rb', line 48

def share
  @share
end