lib/new_relic/agent/transaction.rb
# Yield to a block that is run with a database metric name context.  This means
# the Database instrumentation will use this for the metric name if it does not
# otherwise know about a model.  This is re-entrant.
#
# * <tt>model</tt> is the DB model class
# * <tt>method</tt> is the name of the finder method or other method to identify the operation with.
#
Yield to a block that is run with a database metric name context.  This means
the Database instrumentation will use this for the metric name if it does not
otherwise know about a model.  This is re-entrant.

model is the DB model class
method is the name of the finder method or other method to identify the operation with.
Yield to a block that is run with a database metric name context . This means the Database instrumentation will use this for the metric name if it does not otherwise know about a model . This is re - entrant . model is the DB model class method is the name of the finder method or other method to identify the operation with .
def with_database_metric_name(model, method)
        previous = @database_metric_name
        model_name = case model
                     when Class
                       model.name
                     when String
                       model
                     else
                       model.to_s
                     end
        @database_metric_name = "ActiveRecord/#{model_name}/#{method}"
        yield
      ensure
        @database_metric_name=previous
      end
def with_database_metric_name ( model , method ) previous = @database_metric_name model_name = case model when Class model . name when String model else model . to_s end @database_metric_name = "ActiveRecord/#{model_name}/#{method}" yield ensure @database_metric_name = previous end
Yield to a block that is run with a database metric name context.
Yield to a block that is run with a database metric name context .
model
method