lib/one_apm/transaction.rb in oneapm_rpm-1.1.1 vs lib/one_apm/transaction.rb in oneapm_rpm-1.1.2
- old
+ new
@@ -220,26 +220,10 @@
def instrumentation_state
@instrumentation_state ||= {}
end
- def with_database_metric_name(model, method)
- previous = self.instrumentation_state[:datastore_override]
- model_name = case model
- when Class
- model.name
- when String
- model
- else
- model.to_s
- end
- self.instrumentation_state[:datastore_override] = [method, model_name]
- yield
- ensure
- self.instrumentation_state[:datastore_override] = previous
- end
-
def noticed_error_ids
@noticed_error_ids ||= []
end
def create_nested_frame(state, category, options)
@@ -308,29 +292,7 @@
else
@exceptions[error] = options
end
end
- # 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.
- #
- 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
end
end