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
  • Select an option

  • Save colin/268699 to your computer and use it in GitHub Desktop.

Select an option

Save colin/268699 to your computer and use it in GitHub Desktop.

Revisions

  1. @eric eric created this gist Oct 26, 2009.
    14 changes: 14 additions & 0 deletions newrelic_thinking_sphinx.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    # 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