diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-14 03:09:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-14 03:09:30 +0300 |
commit | 8957ace3159e5369a700a77614493ed6a8a98f93 (patch) | |
tree | 98ff5be0caa30cfebb4e0cd0ae2ceaf21ce92eb4 /lib/gitlab/usage_data.rb | |
parent | 232e0a31f1e5d5b3a788dfc3dba8f8d41df36bf9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/usage_data.rb')
-rw-r--r-- | lib/gitlab/usage_data.rb | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 35c69099b01..c69c49831fa 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -2,7 +2,6 @@ module Gitlab class UsageData - APPROXIMATE_COUNT_MODELS = [Label, MergeRequest, Note, Todo].freeze BATCH_SIZE = 100 class << self @@ -107,10 +106,12 @@ module Gitlab suggestions: count(Suggestion), todos: count(Todo), uploads: count(Upload), - web_hooks: count(WebHook) + web_hooks: count(WebHook), + labels: count(Label), + merge_requests: count(MergeRequest), + notes: count(Note) }.merge( services_usage, - approximate_counts, usage_counters, user_preferences_usage, ingress_modsecurity_usage @@ -251,16 +252,6 @@ module Gitlab fallback end - def approximate_counts - approx_counts = Gitlab::Database::Count.approximate_counts(APPROXIMATE_COUNT_MODELS) - - APPROXIMATE_COUNT_MODELS.each_with_object({}) do |model, result| - key = model.name.underscore.pluralize.to_sym - - result[key] = approx_counts[model] || -1 - end - end - def installation_type if Rails.env.production? Gitlab::INSTALLATION_TYPE |