diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-06-21 11:18:19 +0200 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2019-06-28 12:46:51 +0200 |
commit | 56ae34e49b80c8c93661e00e490d4c9048e70273 (patch) | |
tree | f7ddd9609deb06c8eec66194b5c6251ed071bd31 /lib/gitlab/optimistic_locking.rb | |
parent | 32806aee150239d60783c77ae17811cba139a3ef (diff) | |
download | gitlab-ce-56ae34e49b80c8c93661e00e490d4c9048e70273.tar.gz |
Adds metrics to measure database transactionstransaction-metrics
Currently we don't have good insight into the affect of Rails
transaction blocks on the application. If these blocks are held open for
extended periods, they can have detrimental effects on the application.
This change will allow us to track these transactions, with the aim
of reducing their duration.
Diffstat (limited to 'lib/gitlab/optimistic_locking.rb')
-rw-r--r-- | lib/gitlab/optimistic_locking.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/gitlab/optimistic_locking.rb b/lib/gitlab/optimistic_locking.rb index 868b2ae641a..0c0f46d3b77 100644 --- a/lib/gitlab/optimistic_locking.rb +++ b/lib/gitlab/optimistic_locking.rb @@ -5,6 +5,7 @@ module Gitlab module_function def retry_lock(subject, retries = 100, &block) + # TODO(Observability): We should be recording details of the number of retries and the duration of the total execution here ActiveRecord::Base.transaction do yield(subject) end |