123456789_123456789_123456789_123456789_123456789_

Class: ActiveSupport::Notifications::Event

Relationships & Source Files
Inherits: Object
Defined in: activesupport/lib/active_support/notifications/instrumenter.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(name, start, ending, transaction_id, payload) ⇒ Event

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 50

def initialize(name, start, ending, transaction_id, payload)
  @name           = name
  @payload        = payload.dup
  @time           = start
  @transaction_id = transaction_id
  @end            = ending
  @children       = []
  @duration       = nil
end

Instance Attribute Details

#children (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 47

attr_reader :name, :time, :transaction_id, :payload, :children

#end (rw)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 48

attr_accessor :end

#name (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 47

attr_reader :name, :time, :transaction_id, :payload, :children

#payload (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 47

attr_reader :name, :time, :transaction_id, :payload, :children

#time (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 47

attr_reader :name, :time, :transaction_id, :payload, :children

#transaction_id (readonly)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 47

attr_reader :name, :time, :transaction_id, :payload, :children

Instance Method Details

#<<(event)

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 64

def <<(event)
  @children << event
end

#duration

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 60

def duration
  @duration ||= 1000.0 * (self.end - time)
end

#parent_of?(event) ⇒ Boolean

[ GitHub ]

  
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 68

def parent_of?(event)
  @children.include? event
end