diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-11-20 09:57:55 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-11-20 10:08:48 +0900 |
commit | 273292b8f1dca9108dddd032b7fc09c69c630fc1 (patch) | |
tree | 00f5b4fc00b16f3c8083333ca1e11f21513ca05d | |
parent | 72062c8c9d32237d1eb7d3eb3318f65042383408 (diff) | |
download | rails-273292b8f1dca9108dddd032b7fc09c69c630fc1.tar.gz rails-273292b8f1dca9108dddd032b7fc09c69c630fc1.tar.bz2 rails-273292b8f1dca9108dddd032b7fc09c69c630fc1.zip |
Deprecate `event.end = Time.now` in favor of `event.finish!`
Since #33449, `event.end = Time.now` is not used anymore and should use
`event.finish!`.
We can't use `deprecate :end=` in definition time in this module due to
circular require in `active_support/deprecation/behaviors`.
-rw-r--r-- | activesupport/lib/active_support/notifications/instrumenter.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/notifications/instrumenter.rb b/activesupport/lib/active_support/notifications/instrumenter.rb index 9184f8f54b..a721187d2d 100644 --- a/activesupport/lib/active_support/notifications/instrumenter.rb +++ b/activesupport/lib/active_support/notifications/instrumenter.rb @@ -52,8 +52,7 @@ module ActiveSupport end class Event - attr_reader :name, :time, :transaction_id, :payload, :children - attr_accessor :end + attr_reader :name, :time, :end, :transaction_id, :payload, :children def self.clock_gettime_supported? # :nodoc: defined?(Process::CLOCK_PROCESS_CPUTIME_ID) && @@ -88,6 +87,11 @@ module ActiveSupport @allocation_count_finish = now_allocations end + def end=(ending) + ActiveSupport::Deprecation.deprecation_warning(:end=, :finish!) + @end = ending + end + # Returns the CPU time (in milliseconds) passed since the call to # +start!+ and the call to +finish!+ def cpu_time |