class OneApm::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 intrumentation 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/one_apm/inst/support/evented_subscriber.rb, line 71 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/one_apm/inst/support/evented_subscriber.rb, line 88 def <<(event) @children << event end
duration()
click to toggle source
# File lib/one_apm/inst/support/evented_subscriber.rb, line 84 def duration self.end - time end
metric_name()
click to toggle source
# File lib/one_apm/inst/support/evented_subscriber.rb, line 80 def metric_name raise NotImplementedError end
parent_of?(event)
click to toggle source
# File lib/one_apm/inst/support/evented_subscriber.rb, line 92 def parent_of?(event) @children.include? event end