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>2019-11-06 12:06:23 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-06 12:06:23 +0300
commitd15180e00b209d0fbe3d8ce61b3af269aecdf7f5 (patch)
treee24bcc044a3e471811b91ade8a23120a27210c3f /lib/gitlab/usage_data_counters
parent505c40d537244b35807129ade0c577f752e9d564 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/usage_data_counters')
-rw-r--r--lib/gitlab/usage_data_counters/web_ide_counter.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/gitlab/usage_data_counters/web_ide_counter.rb b/lib/gitlab/usage_data_counters/web_ide_counter.rb
index 0718c1dd761..c012a6c96df 100644
--- a/lib/gitlab/usage_data_counters/web_ide_counter.rb
+++ b/lib/gitlab/usage_data_counters/web_ide_counter.rb
@@ -8,6 +8,7 @@ module Gitlab
COMMITS_COUNT_KEY = 'WEB_IDE_COMMITS_COUNT'
MERGE_REQUEST_COUNT_KEY = 'WEB_IDE_MERGE_REQUESTS_COUNT'
VIEWS_COUNT_KEY = 'WEB_IDE_VIEWS_COUNT'
+ PREVIEW_COUNT_KEY = 'WEB_IDE_PREVIEWS_COUNT'
class << self
def increment_commits_count
@@ -34,11 +35,22 @@ module Gitlab
total_count(VIEWS_COUNT_KEY)
end
+ def increment_previews_count
+ return unless Gitlab::CurrentSettings.web_ide_clientside_preview_enabled?
+
+ increment(PREVIEW_COUNT_KEY)
+ end
+
+ def total_previews_count
+ total_count(PREVIEW_COUNT_KEY)
+ end
+
def totals
{
web_ide_commits: total_commits_count,
web_ide_views: total_views_count,
- web_ide_merge_requests: total_merge_requests_count
+ web_ide_merge_requests: total_merge_requests_count,
+ web_ide_previews: total_previews_count
}
end
end