Commit d2d12c8e authored by Alex Buijs's avatar Alex Buijs Committed by Mayra Cabrera

Add usage statistics data for secure stage

Added usage activity data for the secure stage
parent 8229b1d1
......@@ -175,6 +175,7 @@ module EE
package: usage_activity_by_stage_package,
plan: usage_activity_by_stage_plan,
release: usage_activity_by_stage_release,
secure: usage_activity_by_stage_secure,
verify: usage_activity_by_stage_verify
}
}
......@@ -270,6 +271,15 @@ module EE
projects_reporting_ci_cd_back_to_github: ::Project.with_github_service_pipeline_events.distinct_count_by(:creator_id)
}
end
# Currently too complicated and to get reliable counts for these stats:
# container_scanning_jobs, dast_jobs, dependency_scanning_jobs, license_management_jobs, sast_jobs
# Once https://gitlab.com/gitlab-org/gitlab/merge_requests/17568 is merged, this might be doable
def usage_activity_by_stage_secure
{
user_preferences_group_overview_security_dashboard: count(::User.active.group_view_security_dashboard)
}
end
end
end
end
......
......@@ -170,6 +170,16 @@ describe Gitlab::UsageData do
end
end
context 'for secure' do
it 'includes accurate usage_activity_by_stage data' do
create(:user, group_view: :security_dashboard)
expect(described_class.uncached_data[:usage_activity_by_stage][:secure]).to eq(
user_preferences_group_overview_security_dashboard: 1
)
end
end
context 'for verify' do
it 'includes accurate usage_activity_by_stage data' do
user = create(:user)
......
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