Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
d1b4576a
Commit
d1b4576a
authored
Jun 08, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure peek-performance_bar doesn't break existing functionalities
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
058aeb1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
app/views/peek/views/_mysql2.html.haml
app/views/peek/views/_mysql2.html.haml
+14
-0
config/initializers/peek.rb
config/initializers/peek.rb
+4
-0
lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb
...ab/performance_bar/peek_performance_bar_with_rack_body.rb
+22
-0
No files found.
app/views/peek/views/_mysql2.html.haml
0 → 100644
View file @
d1b4576a
%strong
%a
#peek-show-queries
{
href:
'#'
}
%span
{
data:
{
defer_to:
"#{view.defer_key}-duration"
}
}
...
\/
%span
{
data:
{
defer_to:
"#{view.defer_key}-calls"
}
}
...
#modal-peek-pg-queries
.modal
{
tabindex:
-
1
}
.modal-dialog
#modal-peek-pg-queries-content
.modal-content
.modal-header
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%h4
SQL queries
.modal-body
{
data:
{
defer_to:
"#{view.defer_key}-queries"
}
}
...
mysql
config/initializers/peek.rb
View file @
d1b4576a
...
...
@@ -26,3 +26,7 @@ class PEEK_DB_CLIENT
end
PEEK_DB_VIEW
.
prepend
::
Gitlab
::
PerformanceBar
::
PeekQueryTracker
class
Peek::Views::PerformanceBar::ProcessUtilization
prepend
::
Gitlab
::
PerformanceBar
::
PeekPerformanceBarWithRackBody
end
lib/gitlab/performance_bar/peek_performance_bar_with_rack_body.rb
0 → 100644
View file @
d1b4576a
# This solves a bug with a X-Senfile header that wouldn't be set properly, see
# https://github.com/peek/peek-performance_bar/pull/27
module
Gitlab
module
PerformanceBar
module
PeekPerformanceBarWithRackBody
def
call
(
env
)
@env
=
env
reset_stats
@total_requests
+=
1
first_request
if
@total_requests
==
1
env
[
'process.request_start'
]
=
@start
.
to_f
env
[
'process.total_requests'
]
=
total_requests
status
,
headers
,
body
=
@app
.
call
(
env
)
body
=
Rack
::
BodyProxy
.
new
(
body
)
{
record_request
}
[
status
,
headers
,
body
]
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment