Sha256: f3a226a0d920fed3c428769d8f6f022fcb9cc04e380dfc2df0a11133e55848ba

Contents?: true

Size: 1.15 KB

Versions: 2

Compression:

Stored size: 1.15 KB

Contents

require 'agent/server/instrument/rails'
require 'agent/server/instrument/sinatra'
require 'agent/server/instrument/active_record'
require 'agent/server/instrument/action_view'
require 'agent/server/instrument/sidekiq_server'

module ManageEngine
  class Environment
    
    SUPPORTED_FRAMEWORKS = [
        ManageEngine::Instrumentation::RailsFramework.new,
        ManageEngine::Instrumentation::SinatraFramework.new
    ]
    
    DATABASE_INTERCEPTORS = [
        ManageEngine::Instrumentation::ActiveRecordSQL.new
    ]
    
    OTHER_INTERCEPTORS = [
        ManageEngine::Instrumentation::ActionView.new,
        ManageEngine::Instrumentation::SidekiqServer.new
    ]
    
    def detect_and_instrument
      @framework ||= SUPPORTED_FRAMEWORKS.detect{ |framework| framework.present? }
      if (@framework != nil)
        @framework.instrument
      end
      
      DATABASE_INTERCEPTORS.each do |interceptor|
        if (interceptor.present?)
          interceptor.instrument
        end
      end
      
      OTHER_INTERCEPTORS.each do |interceptor|
        if (interceptor.present?)
          interceptor.instrument
        end
      end
    end
    
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
apminsight-1.9.0 lib/agent/server/instrument/environment.rb
site24x7_apminsight-1.9.0 lib/agent/server/instrument/environment.rb