Method: OneApm::Collector::Commands::XraySessionCollection#add_session

Defined in:
lib/one_apm/collector/commands/xray_session_collection.rb

#add_session(session) ⇒ Object



109
110
111
112
113
114
115
116
117
118
119
# File 'lib/one_apm/collector/commands/xray_session_collection.rb', line 109

def add_session(session)
  OneApm::Manager.logger.debug("Adding X-Ray session #{session.inspect}")
  OneApm::Manager.increment_metric("Supportability/XraySessions/Starts")

  @sessions_lock.synchronize { @sessions[session.id] = session }

  session.activate
  if session.run_profiler?
    @backtrace_service.subscribe(session.key_transaction_name, session.command_arguments)
  end
end