diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2016-07-15 17:46:39 +0200 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2016-07-26 20:06:09 +0200 |
commit | 345cd22f21e4e5a6e340c35e50b43105ee107570 (patch) | |
tree | d1f3916535c9bca94cb9c8fe16559332dcbf762e /app/controllers/admin/requests_profiles_controller.rb | |
parent | 0c799be6b6fc0166473c82039ebf662a0558ed8f (diff) | |
download | gitlab-ce-345cd22f21e4e5a6e340c35e50b43105ee107570.tar.gz |
Profile requests when a header is passedfeature/profile-requests-conditionally
Diffstat (limited to 'app/controllers/admin/requests_profiles_controller.rb')
-rw-r--r-- | app/controllers/admin/requests_profiles_controller.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/admin/requests_profiles_controller.rb b/app/controllers/admin/requests_profiles_controller.rb new file mode 100644 index 00000000000..a478176e138 --- /dev/null +++ b/app/controllers/admin/requests_profiles_controller.rb @@ -0,0 +1,17 @@ +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 + render text: profile.content + else + redirect_to admin_requests_profiles_path, alert: 'Profile not found' + end + end +end |