class NewRelic::Agent::Instrumentation::Event

Taken from ActiveSupport::Notifications::Event, pasted here with a couple minor additions so we don't have a hard dependency on ActiveSupport::Notifications.

Represents an instrumentation event, provides timing and metric name information useful when recording metrics.

Attributes

children[R]
end[RW]
frame[RW]
name[R]
parent[RW]
payload[R]
time[R]
transaction_id[R]

Public Class Methods

new(name, start, ending, transaction_id, payload) click to toggle source
# File lib/new_relic/agent/instrumentation/evented_subscriber.rb, line 72
def initialize(name, start, ending, transaction_id, payload)
  @name           = name
  @payload        = payload.dup
  @time           = start
  @transaction_id = transaction_id
  @end            = ending
  @children       = []
end

Public Instance Methods

<<(event) click to toggle source
# File lib/new_relic/agent/instrumentation/evented_subscriber.rb, line 89
def <<(event)
  @children << event
end
duration() click to toggle source
# File lib/new_relic/agent/instrumentation/evented_subscriber.rb, line 85
def duration
  self.end - time
end
metric_name() click to toggle source
# File lib/new_relic/agent/instrumentation/evented_subscriber.rb, line 81
def metric_name
  raise NotImplementedError
end
parent_of?(event) click to toggle source
# File lib/new_relic/agent/instrumentation/evented_subscriber.rb, line 93
def parent_of?(event)
  @children.include? event
end