summaryrefslogtreecommitdiff
path: root/lib/gitlab
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2019-05-17 09:10:29 +0000
committerJames Lopez <james@gitlab.com>2019-05-17 09:10:29 +0000
commita3f80f9f2e83298a0fe0cf6637871822bb1a8edb (patch)
treea740d5eb1a838e4796d0fef0110ffa078e4dd7ba /lib/gitlab
parent74fa088b873d126d97656ec90881ff5a1561b30a (diff)
downloadgitlab-ce-a3f80f9f2e83298a0fe0cf6637871822bb1a8edb.tar.gz
Add PoolRepository to the usage ping
PoolRepository is a relatively new model of which the counts could help to further determine the priority of new features. Also gives some insight into the number of forks customers have.
Diffstat (limited to 'lib/gitlab')
-rw-r--r--lib/gitlab/usage_data.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 08156d7ffa6..9aa2e972adf 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -26,7 +26,7 @@ module Gitlab
uuid: Gitlab::CurrentSettings.uuid,
hostname: Gitlab.config.gitlab.host,
version: Gitlab::VERSION,
- installation_type: Gitlab::INSTALLATION_TYPE,
+ installation_type: installation_type,
active_user_count: count(User.active),
recorded_at: Time.now,
edition: 'CE'
@@ -81,6 +81,7 @@ module Gitlab
milestone_lists: count(List.milestone),
milestones: count(Milestone),
pages_domains: count(PagesDomain),
+ pool_repositories: count(PoolRepository),
projects: count(Project),
projects_imported_from_github: count(Project.where(import_type: 'github')),
projects_with_repositories_enabled: count(ProjectFeature.where('repository_access_level > ?', ProjectFeature::DISABLED)),
@@ -190,6 +191,14 @@ module Gitlab
result[key] = approx_counts[model] || -1
end
end
+
+ def installation_type
+ if Rails.env.production?
+ Gitlab::INSTALLATION_TYPE
+ else
+ "gitlab-development-kit"
+ end
+ end
end
end
end