Skip to content

Instantly share code, notes, and snippets.

@joho
Created March 26, 2010 04:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joho/344515 to your computer and use it in GitHub Desktop.
Save joho/344515 to your computer and use it in GitHub Desktop.
# ThinkingSphinx lazily executes search requests.
# This means that search results aren't usually
# loaded until you iterate over the results in the view.
# This can sometimes make tracking down performance
# problems a little tricky, as new relic will report all
# your time spent rendering such and such partial or view.
# Adding this file to your rails app will make the
# time spent in sphinx properly report itself
require 'new_relic/agent/method_tracer.rb'
if defined?(ThinkingSphinx::Search)
ThinkingSphinx::Search.class_eval do
include NewRelic::Agent::MethodTracer
add_method_tracer :search
add_method_tracer :populate
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment