module ScoutApm::AutoInstrument::InstructionSequence

Public Instance Methods

load_iseq(path) click to toggle source
# File lib/scout_apm/auto_instrument/instruction_sequence.rb, line 7
def load_iseq(path)
  if Rails.controller_path?(path) & !Rails.ignore?(path)
    begin
      new_code = Rails.rewrite(path)
      return self.compile(new_code, path, path)
    rescue
      warn "Failed to apply auto-instrumentation to #{path}: #{$!}"
    end
  elsif Rails.ignore?(path)
    warn "AutoInstruments are ignored for path=#{path}."
  end

  return self.compile_file(path)
end