diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2019-07-19 11:11:27 +0000 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-07-19 11:11:27 +0000 |
commit | 01685eed7674ec841b4249b42f9b350f4a105e4a (patch) | |
tree | 54d710450f9d7a99e6eb9daac4b65efc7bbda6c8 /lib | |
parent | 550ac6ef823d76a7274b562cd63d2dddafa65b2f (diff) | |
download | gitlab-ce-01685eed7674ec841b4249b42f9b350f4a105e4a.tar.gz |
Added Usage Data for some Web IDE actions
The actions tracked in the web IDE are:
- creation of commits
- creation of merge requests
- projects loaded
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/usage_data.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/usage_data_counters/web_ide_counter.rb | 18 |
2 files changed, 21 insertions, 1 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 7572c0bdbfd..43072053e57 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -130,7 +130,9 @@ module Gitlab def usage_counters { - web_ide_commits: Gitlab::UsageDataCounters::WebIdeCounter.total_commits_count + web_ide_commits: Gitlab::UsageDataCounters::WebIdeCounter.total_commits_count, + web_ide_merge_requests: Gitlab::UsageDataCounters::WebIdeCounter.total_merge_requests_count, + web_ide_views: Gitlab::UsageDataCounters::WebIdeCounter.total_views_count } end diff --git a/lib/gitlab/usage_data_counters/web_ide_counter.rb b/lib/gitlab/usage_data_counters/web_ide_counter.rb index 6fbffb94c58..899ad0db9c0 100644 --- a/lib/gitlab/usage_data_counters/web_ide_counter.rb +++ b/lib/gitlab/usage_data_counters/web_ide_counter.rb @@ -6,6 +6,8 @@ module Gitlab extend RedisCounter COMMITS_COUNT_KEY = 'WEB_IDE_COMMITS_COUNT' + MERGE_REQUEST_COUNT_KEY = 'WEB_IDE_MERGE_REQUESTS_COUNT' + VIEWS_COUNT_KEY = 'WEB_IDE_VIEWS_COUNT' class << self def increment_commits_count @@ -15,6 +17,22 @@ module Gitlab def total_commits_count total_count(COMMITS_COUNT_KEY) end + + def increment_merge_requests_count + increment(MERGE_REQUEST_COUNT_KEY) + end + + def total_merge_requests_count + total_count(MERGE_REQUEST_COUNT_KEY) + end + + def increment_views_count + increment(VIEWS_COUNT_KEY) + end + + def total_views_count + total_count(VIEWS_COUNT_KEY) + end end end end |