Module: ScoutApm::Instruments::ActiveRecordUpdateInstruments
- Defined in:
- lib/scout_apm/instruments/active_record.rb
Instance Method Summary collapse
Instance Method Details
#save(*args, &block) ⇒ Object
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/scout_apm/instruments/active_record.rb', line 280 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
297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/scout_apm/instruments/active_record.rb', line 297 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 |