Commit 9bb945aa authored by James Lopez's avatar James Lopez

Merge branch '8320-add-usage-ping-for-package-management' into 'master'

Resolve "Add usage ping for Package Management"

Closes #8320

See merge request gitlab-org/gitlab-ee!8641
parents 7a1be9d5 b9eedab1
---
title: Add count of projects with at least one package to a usage ping data
merge_request: 8641
author:
type: other
......@@ -100,7 +100,8 @@ module EE
ldap_users: count(::User.ldap),
projects_reporting_ci_cd_back_to_github: count(::GithubService.without_defaults.active),
projects_mirrored_with_pipelines_enabled: projects_mirrored_with_pipelines_enabled,
projects_with_prometheus_alerts: count(PrometheusAlert.distinct_projects)
projects_with_prometheus_alerts: count(PrometheusAlert.distinct_projects),
projects_with_packages: count(::Packages::Package.select('distinct project_id'))
}).merge(service_desk_counts).merge(security_products_usage)
usage_data
......
......@@ -18,6 +18,10 @@ describe Gitlab::UsageData do
create(:prometheus_alert, project: projects[0])
create(:prometheus_alert, project: projects[0])
create(:prometheus_alert, project: projects[1])
create(:package, project: projects[0])
create(:package, project: projects[0])
create(:package, project: projects[1])
end
subject { described_class.data }
......@@ -59,9 +63,11 @@ describe Gitlab::UsageData do
license_management_jobs
sast_jobs
projects_with_prometheus_alerts
projects_with_packages
))
expect(count_data[:projects_with_prometheus_alerts]).to eq(2)
expect(count_data[:projects_with_packages]).to eq(2)
end
it 'gathers security products usage data' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment