Class: ActiveSupport::Notifications::Event
- Inherits:
-
Object
- Object
- ActiveSupport::Notifications::Event
- Defined in:
- activesupport/lib/active_support/notifications/instrumenter.rb
Instance Attribute Summary (collapse)
-
- (Object) duration
readonly
Returns the value of attribute duration.
-
- (Object) end
readonly
Returns the value of attribute end.
-
- (Object) name
readonly
Returns the value of attribute name.
-
- (Object) payload
readonly
Returns the value of attribute payload.
-
- (Object) time
readonly
Returns the value of attribute time.
-
- (Object) transaction_id
readonly
Returns the value of attribute transaction_id.
Instance Method Summary (collapse)
-
- (Event) initialize(name, start, ending, transaction_id, payload)
constructor
A new instance of Event.
- - (Boolean) parent_of?(event)
Constructor Details
- (Event) initialize(name, start, ending, transaction_id, payload)
A new instance of Event
39 40 41 42 43 44 45 46 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 39 def initialize(name, start, ending, transaction_id, payload) @name = name @payload = payload.dup @time = start @transaction_id = transaction_id @end = ending @duration = 1000.0 * (@end - @time) end |
Instance Attribute Details
- (Object) duration (readonly)
Returns the value of attribute duration
37 38 39 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 37 def duration @duration end |
- (Object) end (readonly)
Returns the value of attribute end
37 38 39 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 37 def end @end end |
- (Object) name (readonly)
Returns the value of attribute name
37 38 39 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 37 def name @name end |
- (Object) payload (readonly)
Returns the value of attribute payload
37 38 39 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 37 def payload @payload end |
- (Object) time (readonly)
Returns the value of attribute time
37 38 39 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 37 def time @time end |
- (Object) transaction_id (readonly)
Returns the value of attribute transaction_id
37 38 39 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 37 def transaction_id @transaction_id end |
Instance Method Details
- (Boolean) parent_of?(event)
48 49 50 51 |
# File 'activesupport/lib/active_support/notifications/instrumenter.rb', line 48 def parent_of?(event) start = (time - event.time) * 1000 start <= 0 && (start + duration >= event.duration) end |