summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPawel Chojnacki <pawel@chojnacki.ws>2017-09-07 22:59:27 +0200
committerPawel Chojnacki <pawel@chojnacki.ws>2017-11-02 18:11:44 +0100
commit19634c259da768700c1d6382c097fed7ef98fdca (patch)
treebaa5265f9d1d9369138d904e55e6a817d652a264 /lib
parentc361c1e857fe165e7a838aea1ecf7a10982cdbe0 (diff)
downloadgitlab-ce-19634c259da768700c1d6382c097fed7ef98fdca.tar.gz
Cleanup metrics names and removing unnecessary cache read total
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/metrics/subscribers/rails_cache.rb20
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/gitlab/metrics/subscribers/rails_cache.rb b/lib/gitlab/metrics/subscribers/rails_cache.rb
index 17814f6b845..da5bf208e74 100644
--- a/lib/gitlab/metrics/subscribers/rails_cache.rb
+++ b/lib/gitlab/metrics/subscribers/rails_cache.rb
@@ -15,17 +15,9 @@ module Gitlab
)
end
- def self.metric_cache_read_hit_total
- @metric_cache_read_hit_total ||= Gitlab::Metrics.counter(
- :gitlab_cache_read_hit_total,
- 'Cache read hit',
- Transaction::BASE_LABELS
- )
- end
-
- def self.metric_cache_read_miss_total
- @metric_cache_read_miss_total ||= Gitlab::Metrics.counter(
- :gitlab_cache_read_miss_total,
+ def self.metric_cache_misses_total
+ @metric_cache_misses_total ||= Gitlab::Metrics.counter(
+ :gitlab_cache_misses_total,
'Cache read miss',
Transaction::BASE_LABELS
)
@@ -38,10 +30,9 @@ module Gitlab
return if event.payload[:super_operation] == :fetch
if event.payload[:hit]
- self.class.metric_cache_read_hit_total.increment(current_transaction.labels)
current_transaction.increment(:cache_read_hit_count, 1, false)
else
- self.class.metric_cache_read_miss_total.increment(current_transaction.labels)
+ self.class.metric_cache_misses_total.increment(current_transaction.labels)
current_transaction.increment(:cache_read_miss_count, 1, false)
end
end
@@ -61,14 +52,13 @@ module Gitlab
def cache_fetch_hit(event)
return unless current_transaction
- self.class.metric_cache_read_hit_total.increment(current_transaction.labels)
current_transaction.increment(:cache_read_hit_count, 1)
end
def cache_generate(event)
return unless current_transaction
- self.class.metric_cache_read_miss_total.increment(current_transaction.labels)
+ self.class.metric_cache_misses_total.increment(current_transaction.labels)
current_transaction.increment(:cache_read_miss_count, 1)
end