Module: ScoutApm::Instruments::ActiveRecordUpdateInstruments
- Defined in:
- lib/scout_apm/instruments/active_record.rb
Instance Method Summary collapse
Instance Method Details
#save(*args, &block) ⇒ Object
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/scout_apm/instruments/active_record.rb', line 349 def save(*args, &block) model = self.class.name operation = self.persisted? ? "Update" : "Create" req = ScoutApm::RequestManager.lookup layer = ScoutApm::Layer.new("ActiveRecord", Utils::ActiveRecordMetricName.new("", "#{model} #{operation}")) layer.desc = SqlList.new req.start_layer(layer) req.ignore_children! begin super(*args, &block) ensure req.acknowledge_children! req.stop_layer end end |
#save!(*args, &block) ⇒ Object
366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 |
# File 'lib/scout_apm/instruments/active_record.rb', line 366 def save!(*args, &block) model = self.class.name operation = self.persisted? ? "Update" : "Create" req = ScoutApm::RequestManager.lookup layer = ScoutApm::Layer.new("ActiveRecord", Utils::ActiveRecordMetricName.new("", "#{model} #{operation}")) req.start_layer(layer) req.ignore_children! begin super(*args, &block) ensure req.acknowledge_children! req.stop_layer end end |