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
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
Show 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)
...
@@ -18,6 +18,9 @@ v 8.8.0 (unreleased)
- Added multiple colors for labels in dropdowns when dups happen.
- Added multiple colors for labels in dropdowns when dups happen.
- Improve description for the Two-factor Authentication sign-in screen. (Connor Shea)
- 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
v 8.7.2
- The "New Branch" button is now loaded asynchronously
- The "New Branch" button is now loaded asynchronously
- Fix error 500 when trying to create a wiki page
- Fix error 500 when trying to create a wiki page
...
...
config/initializers/metrics.rb
View file @
917c26ce
...
@@ -61,11 +61,29 @@ if Gitlab::Metrics.enabled?
...
@@ -61,11 +61,29 @@ if Gitlab::Metrics.enabled?
config
.
instrument_instance_methods
(
const
)
config
.
instrument_instance_methods
(
const
)
end
end
Dir
[
Rails
.
root
.
join
(
'app'
,
'finders'
,
'*.rb'
)].
each
do
|
path
|
# Path to search => prefix to strip from constant
const
=
File
.
basename
(
path
,
'.rb'
).
camelize
.
constantize
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
)
config
.
instrument_instance_methods
(
const
)
end
end
end
config
.
instrument_methods
(
Premailer
::
Adapter
::
Nokogiri
)
config
.
instrument_instance_methods
(
Premailer
::
Adapter
::
Nokogiri
)
[
[
:Blame
,
:Branch
,
:BranchCollection
,
:Blob
,
:Commit
,
:Diff
,
:Repository
,
:Blame
,
:Branch
,
:BranchCollection
,
:Blob
,
:Commit
,
:Diff
,
:Repository
,
...
@@ -97,17 +115,6 @@ if Gitlab::Metrics.enabled?
...
@@ -97,17 +115,6 @@ if Gitlab::Metrics.enabled?
config
.
instrument_methods
(
Gitlab
::
ReferenceExtractor
)
config
.
instrument_methods
(
Gitlab
::
ReferenceExtractor
)
config
.
instrument_instance_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.
# Instrument the classes used for checking if somebody has push access.
config
.
instrument_instance_methods
(
Gitlab
::
GitAccess
)
config
.
instrument_instance_methods
(
Gitlab
::
GitAccess
)
config
.
instrument_instance_methods
(
Gitlab
::
GitAccessWiki
)
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