Permalink
Browse files

First pass at adding elastic search functions to RPM instrumentation

  • Loading branch information...
1 parent 922b735 commit a584013645ffb63c3e9fd24b2e3424f633004900 Michael Breen committed with jaggederest Mar 8, 2011
Showing with 16 additions and 0 deletions.
  1. +16 −0 lib/rpm_contrib/instrumentation/elastic_search.rb
@@ -0,0 +1,16 @@
+# == Elastic Search Instrumentation
+#
+
+if defined?(::ElasticSearch) and not NewRelic::Control.instance['disable_elastic_search_instrumentation']
+
+ ::ElasticSearch::Client.class_eval do
+ add_method_tracer :index, 'ActiveRecord/ElasticSearch/index'
+ add_method_tracer :get, 'ActiveRecord/ElasticSearch/get'
+ add_method_tracer :delete, 'ActiveRecord/ElasticSearch/delete'
+ add_method_tracer :search, 'ActiveRecord/ElasticSearch/search'
+ add_method_tracer :scroll, 'ActiveRecord/ElasticSearch/scroll'
+ add_method_tracer :count, 'ActiveRecord/ElasticSearch/count'
+ add_method_tracer :bulk, 'ActiveRecord/ElasticSearch/bulk'
+ end
+
+end

0 comments on commit a584013

Please sign in to comment.