class NewRelic::Agent::Commands::XraySession

Attributes

command_arguments[R]
duration[R]
id[R]
key_transaction_name[R]
requested_trace_count[R]
sample_period[R]
xray_session_name[R]

Public Class Methods

new(command_arguments) click to toggle source
# File lib/new_relic/agent/commands/xray_session.rb, line 16
def initialize(command_arguments)
  @command_arguments     = command_arguments
  @id                    = command_arguments.fetch("x_ray_id", nil)
  @xray_session_name     = command_arguments.fetch("xray_session_name", "")
  @key_transaction_name  = command_arguments.fetch("key_transaction_name", "")
  @requested_trace_count = command_arguments.fetch("requested_trace_count", 100)
  @duration              = command_arguments.fetch("duration", 86400)
  @sample_period         = command_arguments.fetch("sample_period", 0.1)
  @run_profiler          = command_arguments.fetch("run_profiler", true)
end

Public Instance Methods

activate() click to toggle source
# File lib/new_relic/agent/commands/xray_session.rb, line 35
def activate
  @active = true
  @start_time = Time.now
end
active?() click to toggle source
# File lib/new_relic/agent/commands/xray_session.rb, line 27
def active?
  @active
end
deactivate() click to toggle source
# File lib/new_relic/agent/commands/xray_session.rb, line 40
def deactivate
  @active = false
end
finished?() click to toggle source
# File lib/new_relic/agent/commands/xray_session.rb, line 48
def finished?
  @start_time + @duration < Time.now
end
requested_period() click to toggle source
# File lib/new_relic/agent/commands/xray_session.rb, line 44
def requested_period
  @sample_period
end
run_profiler?() click to toggle source
# File lib/new_relic/agent/commands/xray_session.rb, line 31
def run_profiler?
  @run_profiler && NewRelic::Agent.config[:'xray_session.allow_profiles']
end