From f2a80db56b9e8d5b33127356036602431dc08cd5 Mon Sep 17 00:00:00 2001 From: Vishal Telangre Date: Tue, 16 Apr 2019 03:30:24 +0530 Subject: Use monotonic time to record `started` and `finished` time values for an event subscribed by a `ActiveSupport::Notifications::Fanout::Subscribers::Timed` subscriber --- activesupport/lib/active_support/notifications/fanout.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/notifications/fanout.rb b/activesupport/lib/active_support/notifications/fanout.rb index c506b35b1e..8812b67f63 100644 --- a/activesupport/lib/active_support/notifications/fanout.rb +++ b/activesupport/lib/active_support/notifications/fanout.rb @@ -180,13 +180,13 @@ module ActiveSupport def start(name, id, payload) timestack = Thread.current[:_timestack] ||= [] - timestack.push Time.now + timestack.push Concurrent.monotonic_time end def finish(name, id, payload) timestack = Thread.current[:_timestack] started = timestack.pop - @delegate.call(name, started, Time.now, id, payload) + @delegate.call(name, started, Concurrent.monotonic_time, id, payload) end end -- cgit v1.2.3