diff options
author | Douwe Maan <douwe@gitlab.com> | 2016-07-27 01:07:15 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2016-07-27 01:07:15 +0300 |
commit | 95efb6f1163b7c2c40d03ddd834016905fc45b50 (patch) | |
tree | 6208c2482149bd5215903af6271064be26d15875 /app/views | |
parent | 74e17ed9eda95646d8defd495962be9dd3771eac (diff) | |
parent | ef8d9c269a8383ba2e3766b13b44b655e0588609 (diff) |
Merge branch 'feature/profile-requests-conditionally' into 'master'
Return request profiling info when a header is passed
## What does this MR do?
It allows returning profiling info (instead of actual content) when a certain header is passed
## Why was this MR needed?
To facilitate having a performance overview of certain requests.
## What are the relevant issue numbers?
https://gitlab.com/gitlab-com/infrastructure/issues/211
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support added~~
- ~~Tests~~
- [ ] ~~Added for this feature/bug~~
- [ ] ~~All builds are passing~~
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5281
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/admin/background_jobs/_head.html.haml | 4 | ||||
-rw-r--r-- | app/views/admin/requests_profiles/index.html.haml | 26 | ||||
-rw-r--r-- | app/views/layouts/nav/_admin.html.haml | 2 |
3 files changed, 31 insertions, 1 deletions
diff --git a/app/views/admin/background_jobs/_head.html.haml b/app/views/admin/background_jobs/_head.html.haml index 9d722bd7382..89d7a40d6b0 100644 --- a/app/views/admin/background_jobs/_head.html.haml +++ b/app/views/admin/background_jobs/_head.html.haml @@ -16,3 +16,7 @@ = link_to admin_health_check_path, title: 'Health Check' do %span Health Check + = nav_link(controller: :requests_profiles) do + = link_to admin_requests_profiles_path, title: 'Requests Profiles' do + %span + Requests Profiles diff --git a/app/views/admin/requests_profiles/index.html.haml b/app/views/admin/requests_profiles/index.html.haml new file mode 100644 index 00000000000..ae918086a57 --- /dev/null +++ b/app/views/admin/requests_profiles/index.html.haml @@ -0,0 +1,26 @@ +- @no_container = true +- page_title 'Requests Profiles' += render 'admin/background_jobs/head' + +%div{ class: container_class } + %h3.page-title + = page_title + + .bs-callout.clearfix + Pass the header + %code X-Profile-Token: #{@profile_token} + to profile the request + + - if @profiles.present? + .prepend-top-default + - @profiles.each do |path, profiles| + .panel.panel-default.panel-small + .panel-heading + %code= path + %ul.content-list + - profiles.each do |profile| + %li + = link_to profile.time.to_s(:long), admin_requests_profile_path(profile), data: {no_turbolink: true} + - else + %p + No profiles found diff --git a/app/views/layouts/nav/_admin.html.haml b/app/views/layouts/nav/_admin.html.haml index 5ee8772882e..ac04f57e217 100644 --- a/app/views/layouts/nav/_admin.html.haml +++ b/app/views/layouts/nav/_admin.html.haml @@ -9,7 +9,7 @@ = link_to admin_root_path, title: 'Overview', class: 'shortcuts-tree' do %span Overview - = nav_link(controller: %w(system_info background_jobs logs health_check)) do + = nav_link(controller: %w(system_info background_jobs logs health_check requests_profiles)) do = link_to admin_system_info_path, title: 'Monitoring' do %span Monitoring |