Sha256: e50dead0d56fd229edf393b981d0212066def5e2497e2cd359f7c46105f83528

Contents?: true

Size: 743 Bytes

Versions: 7

Compression:

Stored size: 743 Bytes

Contents

DependencyDetection.defer do
  depends_on do
    defined?(::Sunspot)
  end

  executes do
    NewRelic::Agent.logger.debug 'Installing Rails Sunspot instrumentation'
  end
  
  executes do
    ::Sunspot.module_eval do
      class << self
        %w(index index!).each do |method|
          add_method_tracer method, 'SolrClient/Sunspot/index'
        end
        add_method_tracer :commit, 'SolrClient/Sunspot/commit'

        %w[search more_like_this].each do |method|
          add_method_tracer method, 'SolrClient/Sunspot/query'
        end
        %w[remove remove! remove_by_id remove_by_id! remove_all remove_all!].each do |method|
          add_method_tracer method, 'SolrClient/Sunspot/delete'
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
newrelic_rpm-3.1.2 lib/new_relic/agent/instrumentation/sunspot.rb
newrelic_rpm-3.1.2.beta2 lib/new_relic/agent/instrumentation/sunspot.rb
newrelic_rpm-3.1.2.beta1 lib/new_relic/agent/instrumentation/sunspot.rb
newrelic_rpm-3.1.1 lib/new_relic/agent/instrumentation/sunspot.rb
newrelic_rpm-3.1.1.beta3 lib/new_relic/agent/instrumentation/sunspot.rb
newrelic_rpm-3.1.1.beta2 lib/new_relic/agent/instrumentation/sunspot.rb
newrelic_rpm-3.1.1.beta1 lib/new_relic/agent/instrumentation/sunspot.rb