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-03-14 03:09:30 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-14 03:09:30 +0300
commit8957ace3159e5369a700a77614493ed6a8a98f93 (patch)
tree98ff5be0caa30cfebb4e0cd0ae2ceaf21ce92eb4 /lib/gitlab/usage_data.rb
parent232e0a31f1e5d5b3a788dfc3dba8f8d41df36bf9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/usage_data.rb')
-rw-r--r--lib/gitlab/usage_data.rb17
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