Skip to content

Commit

Permalink
Merge pull request #50767 from rporrasluc/fix-db-runtime-calculation
Browse files Browse the repository at this point in the history
Fix calculation of SQL runtime
  • Loading branch information
byroot committed Jan 16, 2024
2 parents 0656787 + a88ee05 commit 758e6e1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion activerecord/lib/active_record/runtime_registry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def reset
end

ActiveSupport::Notifications.monotonic_subscribe("sql.active_record") do |name, start, finish, id, payload|
runtime = finish - start
runtime = (finish - start) * 1_000.0

if payload[:async]
ActiveRecord::RuntimeRegistry.async_sql_runtime += (runtime - payload[:lock_wait])
end
Expand Down

0 comments on commit 758e6e1

Please sign in to comment.