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
d38671b9
Commit
d38671b9
authored
Mar 18, 2021
by
Quang-Minh Nguyen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch a different method to prevent re-iteration
parent
68fd4406
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
ee/lib/ee/peek/views/active_record.rb
ee/lib/ee/peek/views/active_record.rb
+6
-8
lib/peek/views/active_record.rb
lib/peek/views/active_record.rb
+12
-8
No files found.
ee/lib/ee/peek/views/active_record.rb
View file @
d38671b9
...
...
@@ -17,15 +17,13 @@ module EE
detail
end
override
:summary
def
summary
override
:count_summary
def
count_summary
(
item
,
count
)
super
if
::
Gitlab
::
Database
::
LoadBalancing
.
enable?
detail_store
.
each_with_object
(
super
)
do
|
item
,
count
|
count
[
item
[
:db_role
]]
||=
0
count
[
item
[
:db_role
]]
+=
1
end
else
super
count
[
item
[
:db_role
]]
||=
0
count
[
item
[
:db_role
]]
+=
1
end
end
end
...
...
lib/peek/views/active_record.rb
View file @
d38671b9
...
...
@@ -29,15 +29,19 @@ module Peek
def
summary
detail_store
.
each_with_object
({})
do
|
item
,
count
|
if
item
[
:cached
].
present?
count
[
item
[
:cached
]]
||=
0
count
[
item
[
:cached
]]
+=
1
end
count_summary
(
item
,
count
)
end
end
def
count_summary
(
item
,
count
)
if
item
[
:cached
].
present?
count
[
item
[
:cached
]]
||=
0
count
[
item
[
:cached
]]
+=
1
end
if
item
[
:transaction
].
present?
count
[
item
[
:transaction
]]
||=
0
count
[
item
[
:transaction
]]
+=
1
end
if
item
[
:transaction
].
present?
count
[
item
[
:transaction
]]
||=
0
count
[
item
[
:transaction
]]
+=
1
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