diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-01 15:08:56 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-01 15:08:56 +0000 |
commit | e92c95bf459ea6237b1fe1cbd3e6fc7d0eca8f85 (patch) | |
tree | 080fec6e5ea63a30f6d1f313d585266e88db2344 /lib | |
parent | 9ecdb93f4e7e85ffc1e7a768780bb1279827a6aa (diff) | |
download | gitlab-ce-e92c95bf459ea6237b1fe1cbd3e6fc7d0eca8f85.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/usage_data.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb index 27df913c0f9..e9b87b0000f 100644 --- a/lib/gitlab/usage_data.rb +++ b/lib/gitlab/usage_data.rb @@ -582,6 +582,7 @@ module Gitlab users_created: count(::User.where(time_period), start: user_minimum_id, finish: user_maximum_id), omniauth_providers: filtered_omniauth_provider_names.reject { |name| name == 'group_saml' }, user_auth_by_provider: distinct_count_user_auth_by_provider(time_period), + unique_users_all_imports: unique_users_all_imports(time_period), bulk_imports: { gitlab: distinct_count(::BulkImport.where(time_period, source_type: :gitlab), :user_id) }, @@ -904,6 +905,18 @@ module Gitlab end # rubocop:disable CodeReuse/ActiveRecord + def unique_users_all_imports(time_period) + project_imports = distinct_count(::Project.where(time_period).where.not(import_type: nil), :creator_id) + bulk_imports = distinct_count(::BulkImport.where(time_period), :user_id) + jira_issue_imports = distinct_count(::JiraImportState.where(time_period), :user_id) + csv_issue_imports = distinct_count(Issues::CsvImport.where(time_period), :user_id) + group_imports = distinct_count(::GroupImportState.where(time_period), :user_id) + + project_imports + bulk_imports + jira_issue_imports + csv_issue_imports + group_imports + end + # rubocop:enable CodeReuse/ActiveRecord + + # rubocop:disable CodeReuse/ActiveRecord def distinct_count_user_auth_by_provider(time_period) counts = auth_providers_except_ldap.each_with_object({}) do |provider, hash| hash[provider] = distinct_count( |