diff options
Diffstat (limited to 'lib/gitlab/metrics/subscribers/rails_cache.rb')
-rw-r--r-- | lib/gitlab/metrics/subscribers/rails_cache.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/gitlab/metrics/subscribers/rails_cache.rb b/lib/gitlab/metrics/subscribers/rails_cache.rb index b5e087d107b..b12db9df66d 100644 --- a/lib/gitlab/metrics/subscribers/rails_cache.rb +++ b/lib/gitlab/metrics/subscribers/rails_cache.rb @@ -8,6 +8,17 @@ module Gitlab class RailsCache < ActiveSupport::Subscriber attach_to :active_support + def cache_read_multi(event) + observe(:read_multi, event.duration) + + return unless current_transaction + + current_transaction.observe(:gitlab_cache_read_multikey_count, event.payload[:key].size) do + buckets [10, 50, 100, 1000] + docstring 'Number of keys for mget in read_multi/fetch_multi' + end + end + def cache_read(event) observe(:read, event.duration) |