diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-29 17:05:57 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-05 13:28:06 +0300 |
commit | e9a4d117f2fb6f10af3357a8a6591ba7022d9c62 (patch) | |
tree | 233f4648bc37bda61606297aaed4d615d1207b1c /lib/gitlab/metrics/subscribers | |
parent | c85092ac47dfd0bd3f6585c574f5bfdc1a50515b (diff) |
Instrument cache fetch hit and cache fetch misses
Diffstat (limited to 'lib/gitlab/metrics/subscribers')
-rw-r--r-- | lib/gitlab/metrics/subscribers/rails_cache.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/gitlab/metrics/subscribers/rails_cache.rb b/lib/gitlab/metrics/subscribers/rails_cache.rb index 8e345e8ae4a..277c860fbef 100644 --- a/lib/gitlab/metrics/subscribers/rails_cache.rb +++ b/lib/gitlab/metrics/subscribers/rails_cache.rb @@ -21,6 +21,18 @@ module Gitlab increment(:cache_exists, event.duration) end + def cache_fetch_hit(event) + return unless current_transaction + + current_transaction.increment(:cache_fetch_hit, 1) + end + + def cache_generate(event) + return unless current_transaction + + current_transaction.increment(:cache_fetch_miss, 1) + end + def increment(key, duration) return unless current_transaction |