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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
02a27937
Commit
02a27937
authored
Jul 23, 2019
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide Rugged data if it doesn't exist
parent
291df05e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
lib/peek/views/rugged.rb
lib/peek/views/rugged.rb
+2
-0
spec/lib/peek/views/rugged_spec.rb
spec/lib/peek/views/rugged_spec.rb
+4
-0
No files found.
lib/peek/views/rugged.rb
View file @
02a27937
...
@@ -12,6 +12,8 @@ module Peek
...
@@ -12,6 +12,8 @@ module Peek
end
end
def
results
def
results
return
{}
unless
calls
>
0
{
{
duration:
formatted_duration
,
duration:
formatted_duration
,
calls:
calls
,
calls:
calls
,
...
...
spec/lib/peek/views/rugged_spec.rb
View file @
02a27937
...
@@ -11,6 +11,10 @@ describe Peek::Views::Rugged, :request_store do
...
@@ -11,6 +11,10 @@ describe Peek::Views::Rugged, :request_store do
allow
(
Gitlab
::
RuggedInstrumentation
).
to
receive
(
:peek_enabled?
).
and_return
(
true
)
allow
(
Gitlab
::
RuggedInstrumentation
).
to
receive
(
:peek_enabled?
).
and_return
(
true
)
end
end
it
'returns no results'
do
expect
(
subject
.
results
).
to
eq
({})
end
it
'returns aggregated results'
do
it
'returns aggregated results'
do
::
Gitlab
::
RuggedInstrumentation
.
query_time
+=
1.234
::
Gitlab
::
RuggedInstrumentation
.
query_time
+=
1.234
::
Gitlab
::
RuggedInstrumentation
.
increment_query_count
::
Gitlab
::
RuggedInstrumentation
.
increment_query_count
...
...
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