Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-11-30 14:02:35 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-11-30 14:02:35 +0300
commit434a0ce52d75e13d48eac9ce83774954c7c5d48d (patch)
treede3b7a7cf1ce8b07555f28df592297c76894c90f /lib/api/helpers.rb
parent0a0d9493ca481c56b739a3df27c31262283150fe (diff)
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc2
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 147d8407142..3fa743d70fb 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -536,6 +536,15 @@ module API
)
end
+ def increment_counter(event_name)
+ feature_name = "usage_data_#{event_name}"
+ return unless Feature.enabled?(feature_name)
+
+ Gitlab::UsageDataCounters.count(event_name)
+ rescue => error
+ Gitlab::AppLogger.warn("Redis tracking event failed for event: #{event_name}, message: #{error.message}")
+ end
+
# @param event_name [String] the event name
# @param values [Array|String] the values counted
def increment_unique_values(event_name, values)