diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-29 16:05:57 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-30 14:45:50 +0200 |
commit | 1e0c6ead2c04d5a92f31dfc4dcb48816415d66cb (patch) | |
tree | b3210d23baeb553b376286e5ad6bfde5bfb6e240 | |
parent | 1a68a0a6f55049b4ad42222b0dc667fe625a7604 (diff) | |
download | gitlab-ce-1e0c6ead2c04d5a92f31dfc4dcb48816415d66cb.tar.gz |
Instrument cache fetch hit and cache fetch misses
-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 |