Module: ScoutApm::Instruments::ActiveRecordUpdateInstruments
- Defined in:
- lib/scout_apm/instruments/active_record.rb
Instance Method Summary collapse
Instance Method Details
#save(*args, **options, &block) ⇒ Object
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 |
# File 'lib/scout_apm/instruments/active_record.rb', line 402 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, **options, &block) ⇒ Object
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
# File 'lib/scout_apm/instruments/active_record.rb', line 419 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 |