# File lib/new_relic/agent/instrumentation/active_record_helper.rb, line 40
        def instrument_relation_methods
          ::ActiveRecord::Relation.class_eval do
            alias_method :update_all_without_newrelic, :update_all

            def update_all(*args, &blk)
              ::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
                update_all_without_newrelic(*args, &blk)
              end
            end

            alias_method :delete_all_without_newrelic, :delete_all

            def delete_all(*args, &blk)
              ::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
                delete_all_without_newrelic(*args, &blk)
              end
            end

            alias_method :destroy_all_without_newrelic, :destroy_all

            def destroy_all(*args, &blk)
              ::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
                destroy_all_without_newrelic(*args, &blk)
              end
            end

            alias_method :calculate_without_newrelic, :calculate

            def calculate(*args, &blk)
              ::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
                calculate_without_newrelic(*args, &blk)
              end
            end

            if method_defined?(:pluck)
              alias_method :pluck_without_newrelic, :pluck

              def pluck(*args, &blk)
                ::NewRelic::Agent.with_database_metric_name(self.name, nil, ACTIVE_RECORD) do
                  pluck_without_newrelic(*args, &blk)
                end
              end
            end
          end
        end