summaryrefslogtreecommitdiff
path: root/lib/gitlab/usage_data_counters/redis_counter.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/gitlab/usage_data_counters/redis_counter.rb')
-rw-r--r--lib/gitlab/usage_data_counters/redis_counter.rb10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/gitlab/usage_data_counters/redis_counter.rb b/lib/gitlab/usage_data_counters/redis_counter.rb
index 123b8e1bef1..75d5a75e3a4 100644
--- a/lib/gitlab/usage_data_counters/redis_counter.rb
+++ b/lib/gitlab/usage_data_counters/redis_counter.rb
@@ -3,17 +3,15 @@
module Gitlab
module UsageDataCounters
module RedisCounter
- def increment
+ def increment(redis_counter_key)
+ return unless Gitlab::CurrentSettings.usage_ping_enabled
+
Gitlab::Redis::SharedState.with { |redis| redis.incr(redis_counter_key) }
end
- def total_count
+ def total_count(redis_counter_key)
Gitlab::Redis::SharedState.with { |redis| redis.get(redis_counter_key).to_i }
end
-
- def redis_counter_key
- raise NotImplementedError
- end
end
end
end