Skip to content

Instantly share code, notes, and snippets.

@colin
Forked from eric/newrelic_thinking_sphinx.rb
Created January 4, 2010 18:06
Show Gist options
  • Save colin/268699 to your computer and use it in GitHub Desktop.
Save colin/268699 to your computer and use it in GitHub Desktop.
# NewRelic instrumentation for ThinkingSphinx
if defined? ActiveRecord
ActiveRecord::Base.class_eval do
class << self
add_method_tracer :search, 'ActiveRecord/#{self.name}/search'
add_method_tracer :search, 'ActiveRecord/search', :push_scope => false
add_method_tracer :search, 'ActiveRecord/all', :push_scope => false
add_method_tracer :search_count, 'ActiveRecord/#{self.name}/search_count'
add_method_tracer :search_count, 'ActiveRecord/search_count', :push_scope => false
add_method_tracer :search_count, 'ActiveRecord/all', :push_scope => false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment