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

20 lines
564 B
Ruby
Raw Normal View History

2018-12-05 23:21:45 +05:30
# frozen_string_literal: true
2016-09-13 17:45:13 +05:30
class Admin::RequestsProfilesController < Admin::ApplicationController
def index
@profile_token = Gitlab::RequestProfiler.profile_token
@profiles = Gitlab::RequestProfiler::Profile.all.group_by(&:request_path)
end
def show
clean_name = Rack::Utils.clean_path_info(params[:name])
profile = Gitlab::RequestProfiler::Profile.find(clean_name)
if profile
2019-02-13 22:33:31 +05:30
render html: profile.content.html_safe
2016-09-13 17:45:13 +05:30
else
redirect_to admin_requests_profiles_path, alert: 'Profile not found'
end
end
end