Skip to content

Instantly share code, notes, and snippets.

@eric
Created October 26, 2009 21:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save eric/219071 to your computer and use it in GitHub Desktop.
Save eric/219071 to your computer and use it in GitHub Desktop.
NewRelic instrumentation for ThinkingSphinx
# 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