debian-mirror-gitlab/app/controllers/admin/instance_review_controller.rb

42 lines
1.2 KiB
Ruby
Raw Normal View History

2021-01-03 14:25:43 +05:30
# frozen_string_literal: true
class Admin::InstanceReviewController < Admin::ApplicationController
2021-02-22 17:27:13 +05:30
feature_category :devops_reports
2021-01-03 14:25:43 +05:30
2022-05-07 20:08:51 +05:30
urgency :low
2021-01-03 14:25:43 +05:30
def index
2021-11-18 22:05:49 +05:30
redirect_to("#{Gitlab::SubscriptionPortal.subscriptions_instance_review_url}?#{instance_review_params}")
2021-01-03 14:25:43 +05:30
end
def instance_review_params
result = {
instance_review: {
email: current_user.email,
last_name: current_user.name,
version: ::Gitlab::VERSION
}
}
if Gitlab::CurrentSettings.usage_ping_enabled?
2022-04-04 11:22:00 +05:30
data = Gitlab::Usage::ServicePingReport.for(output: :all_metrics_values, cached: true)
2021-01-03 14:25:43 +05:30
counts = data[:counts]
result[:instance_review].merge!(
users_count: data[:active_user_count],
projects_count: counts[:projects],
groups_count: counts[:groups],
issues_count: counts[:issues],
merge_requests_count: counts[:merge_requests],
internal_pipelines_count: counts[:ci_internal_pipelines],
external_pipelines_count: counts[:ci_external_pipelines],
labels_count: counts[:labels],
milestones_count: counts[:milestones],
snippets_count: counts[:snippets],
notes_count: counts[:notes]
)
end
result.to_query
end
end