Commit b9ed06e2 authored by James Fargher's avatar James Fargher

Merge branch '216174-move-metric-to-counts' into 'master'

Move merge_requests_users under counts section

See merge request gitlab-org/gitlab!34492
parents 9ace12e4 25c08cd4
......@@ -504,6 +504,7 @@ appear to be associated to any of the services running, since they all appear to
| `projects_jira_dvcs_server_active` | `counts` | | | |
| `labels` | `counts` | | | |
| `merge_requests` | `counts` | | | |
| `merge_requests_users` | `counts` | | | |
| `notes` | `counts` | | | |
| `wiki_pages_create` | `counts` | | | |
| `wiki_pages_update` | `counts` | | | |
......
......@@ -37,7 +37,6 @@ module Gitlab
.merge(object_store_usage_data)
.merge(topology_usage_data)
.merge(recording_ce_finish_data)
.merge(merge_requests_usage_data(default_time_period))
end
def to_json(force_refresh: false)
......@@ -162,7 +161,8 @@ module Gitlab
usage_counters,
user_preferences_usage,
ingress_modsecurity_usage,
container_expiration_policies_usage
container_expiration_policies_usage,
merge_requests_usage(default_time_period)
)
}
end
......@@ -400,7 +400,7 @@ module Gitlab
end
# rubocop: disable CodeReuse/ActiveRecord
def merge_requests_usage_data(time_period)
def merge_requests_usage(time_period)
query =
Event
.where(target_type: Event::TARGET_TYPES[:merge_request].to_s)
......
......@@ -580,7 +580,7 @@ describe Gitlab::UsageData, :aggregate_failures do
end
end
describe '#merge_requests_usage_data' do
describe '#merge_requests_usage' do
let(:time_period) { { created_at: 2.days.ago..Time.current } }
let(:merge_request) { create(:merge_request) }
let(:other_user) { create(:user) }
......@@ -597,7 +597,7 @@ describe Gitlab::UsageData, :aggregate_failures do
end
it 'returns the distinct count of users using merge requests (via events table) within the specified time period' do
expect(described_class.merge_requests_usage_data(time_period)).to eq(
expect(described_class.merge_requests_usage(time_period)).to eq(
merge_requests_users: 2
)
end
......
......@@ -78,6 +78,7 @@ module UsageDataHelpers
labels
lfs_objects
merge_requests
merge_requests_users
milestone_lists
milestones
notes
......
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