2018-09-14 01:42:05 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-07-15 11:46:39 -04:00
|
|
|
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-01-10 01:50:51 -05:00
|
|
|
render html: profile.content.html_safe
|
2016-07-15 11:46:39 -04:00
|
|
|
else
|
|
|
|
redirect_to admin_requests_profiles_path, alert: 'Profile not found'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|