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
b173ae6b
Commit
b173ae6b
authored
Jun 07, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix linting, route, and specs
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
af0c6917
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
12 additions
and
18 deletions
+12
-18
app/assets/javascripts/peek.js
app/assets/javascripts/peek.js
+3
-3
app/controllers/application_controller.rb
app/controllers/application_controller.rb
+1
-1
app/views/peek/views/_pg.html.haml
app/views/peek/views/_pg.html.haml
+3
-3
config/initializers/peek.rb
config/initializers/peek.rb
+1
-1
config/routes.rb
config/routes.rb
+1
-1
spec/models/commit_spec.rb
spec/models/commit_spec.rb
+1
-1
vendor/assets/javascripts/peek.js
vendor/assets/javascripts/peek.js
+2
-8
No files found.
app/assets/javascripts/peek.js
View file @
b173ae6b
import
'
vendor/peek
'
;
import
'
vendor/peek
'
;
import
'
vendor/peek.performance_bar
'
;
import
'
vendor/peek.performance_bar
'
;
$
(
document
).
on
(
'
click
'
,
'
#peek-show-queries
'
,
function
(
e
)
{
$
(
document
).
on
(
'
click
'
,
'
#peek-show-queries
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
$
(
'
.peek-rblineprof-modal
'
).
hide
();
$
(
'
.peek-rblineprof-modal
'
).
hide
();
le
t
$modal
=
$
(
'
#modal-peek-pg-queries
'
);
cons
t
$modal
=
$
(
'
#modal-peek-pg-queries
'
);
if
(
$modal
.
length
)
{
if
(
$modal
.
length
)
{
$modal
.
modal
(
'
toggle
'
);
$modal
.
modal
(
'
toggle
'
);
}
}
});
});
$
(
document
).
on
(
'
click
'
,
'
.js-lineprof-file
'
,
function
(
e
)
{
$
(
document
).
on
(
'
click
'
,
'
.js-lineprof-file
'
,
(
e
)
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
$
(
this
).
parents
(
'
.heading
'
).
next
(
'
div
'
).
toggle
();
$
(
this
).
parents
(
'
.heading
'
).
next
(
'
div
'
).
toggle
();
});
});
app/controllers/application_controller.rb
View file @
b173ae6b
...
@@ -19,7 +19,7 @@ class ApplicationController < ActionController::Base
...
@@ -19,7 +19,7 @@ class ApplicationController < ActionController::Base
before_action
:ldap_security_check
before_action
:ldap_security_check
before_action
:sentry_context
before_action
:sentry_context
before_action
:default_headers
before_action
:default_headers
before_action
:add_gon_variables
,
unless:
->
{
request
.
path
.
start_with?
(
'/peek'
)
}
before_action
:add_gon_variables
,
unless:
->
{
request
.
path
.
start_with?
(
'/
-/
peek'
)
}
before_action
:configure_permitted_parameters
,
if: :devise_controller?
before_action
:configure_permitted_parameters
,
if: :devise_controller?
before_action
:require_email
,
unless: :devise_controller?
before_action
:require_email
,
unless: :devise_controller?
...
...
app/views/peek/views/_pg.html.haml
View file @
b173ae6b
%strong
%strong
%a
#peek-show-queries
{
href:
'#'
}
%a
#peek-show-queries
{
href:
'#'
}
%span
{
data:
{
defer_to:
"#{view.defer_key}-duration"
}}
...
%span
{
data:
{
defer_to:
"#{view.defer_key}-duration"
}
}
...
\/
\/
%span
{
data:
{
defer_to:
"#{view.defer_key}-calls"
}}
...
%span
{
data:
{
defer_to:
"#{view.defer_key}-calls"
}
}
...
#modal-peek-pg-queries
.modal
{
tabindex:
-
1
}
#modal-peek-pg-queries
.modal
{
tabindex:
-
1
}
.modal-dialog
.modal-dialog
#modal-peek-pg-queries-content
.modal-content
#modal-peek-pg-queries-content
.modal-content
...
@@ -10,5 +10,5 @@
...
@@ -10,5 +10,5 @@
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%a
.close
{
href:
"#"
,
"data-dismiss"
=>
"modal"
}
×
%h4
%h4
SQL queries
SQL queries
.modal-body
{
data:
{
defer_to:
"#{view.defer_key}-queries"
}}
...
.modal-body
{
data:
{
defer_to:
"#{view.defer_key}-queries"
}
}
...
pg
pg
config/initializers/peek.rb
View file @
b173ae6b
...
@@ -17,6 +17,7 @@ Peek.into Peek::Views::Sidekiq
...
@@ -17,6 +17,7 @@ Peek.into Peek::Views::Sidekiq
Peek
.
into
Peek
::
Views
::
Rblineprof
Peek
.
into
Peek
::
Views
::
Rblineprof
Peek
.
into
Peek
::
Views
::
GC
Peek
.
into
Peek
::
Views
::
GC
# rubocop:disable Style/ClassAndModuleCamelCase
class
PEEK_DB_CLIENT
class
PEEK_DB_CLIENT
class
<<
self
class
<<
self
attr_accessor
:query_details
attr_accessor
:query_details
...
@@ -24,5 +25,4 @@ class PEEK_DB_CLIENT
...
@@ -24,5 +25,4 @@ class PEEK_DB_CLIENT
self
.
query_details
=
Concurrent
::
Array
.
new
self
.
query_details
=
Concurrent
::
Array
.
new
end
end
# rubocop:disable Style/ClassAndModuleCamelCase
PEEK_DB_VIEW
.
prepend
::
Gitlab
::
PerformanceBar
::
PeekQueryTracker
PEEK_DB_VIEW
.
prepend
::
Gitlab
::
PerformanceBar
::
PeekQueryTracker
config/routes.rb
View file @
b173ae6b
...
@@ -11,7 +11,6 @@ Rails.application.routes.draw do
...
@@ -11,7 +11,6 @@ Rails.application.routes.draw do
post
:toggle_award_emoji
,
on: :member
post
:toggle_award_emoji
,
on: :member
end
end
mount
Peek
::
Railtie
=>
'/peek'
draw
:sherlock
draw
:sherlock
draw
:development
draw
:development
draw
:ci
draw
:ci
...
@@ -43,6 +42,7 @@ Rails.application.routes.draw do
...
@@ -43,6 +42,7 @@ Rails.application.routes.draw do
get
'liveness'
=>
'health#liveness'
get
'liveness'
=>
'health#liveness'
get
'readiness'
=>
'health#readiness'
get
'readiness'
=>
'health#readiness'
resources
:metrics
,
only:
[
:index
]
resources
:metrics
,
only:
[
:index
]
mount
Peek
::
Railtie
=>
'/peek'
end
end
# Koding route
# Koding route
...
...
spec/models/commit_spec.rb
View file @
b173ae6b
...
@@ -20,8 +20,8 @@ describe Commit, models: true do
...
@@ -20,8 +20,8 @@ describe Commit, models: true do
end
end
it
'caches the author'
do
it
'caches the author'
do
allow
(
RequestStore
).
to
receive
(
:active?
).
and_return
(
true
)
user
=
create
(
:user
,
email:
commit
.
author_email
)
user
=
create
(
:user
,
email:
commit
.
author_email
)
expect
(
RequestStore
).
to
receive
(
:active?
).
and_return
(
true
)
expect_any_instance_of
(
Commit
).
to
receive
(
:find_author_by_any_email
).
and_call_original
expect_any_instance_of
(
Commit
).
to
receive
(
:find_author_by_any_email
).
and_call_original
expect
(
commit
.
author
).
to
eq
(
user
)
expect
(
commit
.
author
).
to
eq
(
user
)
...
...
vendor/assets/javascripts/peek.js
View file @
b173ae6b
let
requestId
=
null
;
(
function
(
$
)
{
(
function
(
$
)
{
var
fetchRequestResults
,
getRequestId
,
peekEnabled
,
toggleBar
,
updatePerformanceBar
;
var
fetchRequestResults
,
getRequestId
,
peekEnabled
,
toggleBar
,
updatePerformanceBar
;
getRequestId
=
function
()
{
getRequestId
=
function
()
{
if
(
requestId
!=
null
)
{
return
$
(
'
#peek
'
).
data
(
'
request-id
'
);
return
requestId
;
}
else
{
return
$
(
'
#peek
'
).
data
(
'
request-id
'
);
}
};
};
peekEnabled
=
function
()
{
peekEnabled
=
function
()
{
return
$
(
'
#peek
'
).
length
;
return
$
(
'
#peek
'
).
length
;
...
@@ -64,7 +58,7 @@ let requestId = null;
...
@@ -64,7 +58,7 @@ let requestId = null;
}
}
};
};
fetchRequestResults
=
function
()
{
fetchRequestResults
=
function
()
{
return
$
.
ajax
(
'
/peek/results
'
,
{
return
$
.
ajax
(
'
/
-/
peek/results
'
,
{
data
:
{
data
:
{
request_id
:
getRequestId
()
request_id
:
getRequestId
()
},
},
...
...
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