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
Jérome Perrin
gitlab-ce
Commits
917c26ce
Commit
917c26ce
authored
May 04, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add-instrumentation-for-15137' into 'master'
Instrument methods used in email diffs See merge request !4038
parents
b9d9a4d2
f660b217
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
CHANGELOG
CHANGELOG
+3
-0
config/initializers/metrics.rb
config/initializers/metrics.rb
+22
-15
No files found.
CHANGELOG
View file @
917c26ce
...
...
@@ -18,6 +18,9 @@ v 8.8.0 (unreleased)
- Added multiple colors for labels in dropdowns when dups happen.
- Improve description for the Two-factor Authentication sign-in screen. (Connor Shea)
v 8.7.3
- Emails, Gitlab::Email::Message, Gitlab::Diff, and Premailer::Adapter::Nokogiri are now instrumented
v 8.7.2
- The "New Branch" button is now loaded asynchronously
- Fix error 500 when trying to create a wiki page
...
...
config/initializers/metrics.rb
View file @
917c26ce
...
...
@@ -61,12 +61,30 @@ if Gitlab::Metrics.enabled?
config
.
instrument_instance_methods
(
const
)
end
Dir
[
Rails
.
root
.
join
(
'app'
,
'finders'
,
'*.rb'
)].
each
do
|
path
|
const
=
File
.
basename
(
path
,
'.rb'
).
camelize
.
constantize
config
.
instrument_instance_methods
(
const
)
# Path to search => prefix to strip from constant
paths_to_instrument
=
{
[
'app'
,
'finders'
]
=>
[
'app'
,
'finders'
],
[
'app'
,
'mailers'
,
'emails'
]
=>
[
'app'
,
'mailers'
],
[
'app'
,
'services'
,
'**'
]
=>
[
'app'
,
'services'
],
[
'lib'
,
'gitlab'
,
'diff'
]
=>
[
'lib'
],
[
'lib'
,
'gitlab'
,
'email'
,
'message'
]
=>
[
'lib'
]
}
paths_to_instrument
.
each
do
|
(
path
,
prefix
)
|
prefix
=
Rails
.
root
.
join
(
*
prefix
)
Dir
[
Rails
.
root
.
join
(
*
path
+
[
'*.rb'
])].
each
do
|
file_path
|
path
=
Pathname
.
new
(
file_path
).
relative_path_from
(
prefix
)
const
=
path
.
to_s
.
sub
(
'.rb'
,
''
).
camelize
.
constantize
config
.
instrument_methods
(
const
)
config
.
instrument_instance_methods
(
const
)
end
end
config
.
instrument_methods
(
Premailer
::
Adapter
::
Nokogiri
)
config
.
instrument_instance_methods
(
Premailer
::
Adapter
::
Nokogiri
)
[
:Blame
,
:Branch
,
:BranchCollection
,
:Blob
,
:Commit
,
:Diff
,
:Repository
,
:Tag
,
:TagCollection
,
:Tree
...
...
@@ -97,17 +115,6 @@ if Gitlab::Metrics.enabled?
config
.
instrument_methods
(
Gitlab
::
ReferenceExtractor
)
config
.
instrument_instance_methods
(
Gitlab
::
ReferenceExtractor
)
# Instrument all service classes
services
=
Rails
.
root
.
join
(
'app'
,
'services'
)
Dir
[
services
.
join
(
'**'
,
'*.rb'
)].
each
do
|
file_path
|
path
=
Pathname
.
new
(
file_path
).
relative_path_from
(
services
)
const
=
path
.
to_s
.
sub
(
'.rb'
,
''
).
camelize
.
constantize
config
.
instrument_methods
(
const
)
config
.
instrument_instance_methods
(
const
)
end
# Instrument the classes used for checking if somebody has push access.
config
.
instrument_instance_methods
(
Gitlab
::
GitAccess
)
config
.
instrument_instance_methods
(
Gitlab
::
GitAccessWiki
)
...
...
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