Top Level Namespace

Defined Under Namespace

Modules: ProfileIt

Instance Method Summary collapse

Instance Method Details

#add_instrumentsObject

module Instruments



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/profile_it/instruments/active_record_instruments.rb', line 64

def add_instruments
  if defined?(ActiveRecord) && defined?(ActiveRecord::Base)
    ActiveRecord::ConnectionAdapters::AbstractAdapter.module_eval do
      include ::ProfileIt::Instruments::ActiveRecordInstruments
      include ::ProfileIt::Tracer
    end
    ActiveRecord::Base.class_eval do
       include ::ProfileIt::Tracer
    end
  end
rescue
  ProfileIt::Agent.instance.logger.warn "ActiveRecord instrumentation exception: #{$!.message}"
end