Skip to content

Instantly share code, notes, and snippets.

@outoftime
Created February 11, 2011 15:02
Show Gist options
  • Save outoftime/822461 to your computer and use it in GitHub Desktop.
Save outoftime/822461 to your computer and use it in GitHub Desktop.
Add NewRelic execution traces to Mongoid
if defined? ::NewRelic
module Mongoid
class Collection
(%w(find find_one map_reduce) + Collections::Operations::PROXIED - ['<<']).uniq.each do |method|
add_method_tracer method, "MongoDB/\#{@klass}##{method}"
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment