Commit bfc4f278 authored by Dmytro Zaporozhets (DZ)'s avatar Dmytro Zaporozhets (DZ)

Merge branch '224593-update-usage-ping-data-to-track-file-locking-data-2' into 'master'

Add total counts of default branch locks and multi-branch LFS locks to Usage Ping

Closes #224593

See merge request gitlab-org/gitlab!41824
parents e8c1fb74 8d5b82ec
---
title: Adding total counts of default branch locks and multi-branch LFS locks
merge_request: 41824
author:
type: added
......@@ -242,7 +242,9 @@ module EE
start: user_minimum_id,
finish: user_maximum_id),
users_using_path_locks: distinct_count(PathLock.where(time_period), :user_id),
users_using_lfs_locks: distinct_count(LfsFileLock.where(time_period), :user_id)
users_using_lfs_locks: distinct_count(LfsFileLock.where(time_period), :user_id),
total_number_of_path_locks: count(::PathLock.where(time_period)),
total_number_of_locked_files: count(::LfsFileLock.where(time_period))
}, approval_rules_counts)
end
......
......@@ -310,6 +310,9 @@ RSpec.describe Gitlab::UsageData do
create(:path_lock, user: user, project: project, path: '4.txt')
create(:path_lock, user: user, project: project, path: '5.txt')
create(:path_lock, user: user, project: project, path: '6.txt')
create_list(:lfs_file_lock, 3)
create_list(:path_lock, 4)
end
expect(described_class.usage_activity_by_stage_create({})).to include(
......@@ -321,11 +324,13 @@ RSpec.describe Gitlab::UsageData do
merge_requests_with_optional_codeowners: 4,
merge_requests_with_required_codeowners: 8,
projects_imported_from_github: 2,
projects_with_repositories_enabled: 12,
projects_with_repositories_enabled: 26,
protected_branches: 2,
suggestions: 2,
users_using_lfs_locks: 6,
users_using_path_locks: 8
users_using_lfs_locks: 12,
users_using_path_locks: 16,
total_number_of_path_locks: 20,
total_number_of_locked_files: 14
)
expect(described_class.usage_activity_by_stage_create(described_class.last_28_days_time_period)).to include(
approval_project_rules: 6,
......@@ -336,11 +341,13 @@ RSpec.describe Gitlab::UsageData do
merge_requests_with_optional_codeowners: 2,
merge_requests_with_required_codeowners: 4,
projects_imported_from_github: 1,
projects_with_repositories_enabled: 6,
projects_with_repositories_enabled: 13,
protected_branches: 1,
suggestions: 1,
users_using_lfs_locks: 3,
users_using_path_locks: 4
users_using_lfs_locks: 6,
users_using_path_locks: 8,
total_number_of_path_locks: 10,
total_number_of_locked_files: 7
)
end
end
......
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