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
82991293
Commit
82991293
authored
Apr 12, 2016
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Instrument all service classes
Fixes gitlab-org/gitlab-ce#15162
parent
8cb41f19
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
config/initializers/metrics.rb
config/initializers/metrics.rb
+12
-0
No files found.
config/initializers/metrics.rb
View file @
82991293
if
Gitlab
::
Metrics
.
enabled?
if
Gitlab
::
Metrics
.
enabled?
require
'pathname'
require
'influxdb'
require
'influxdb'
require
'connection_pool'
require
'connection_pool'
require
'method_source'
require
'method_source'
...
@@ -98,6 +99,17 @@ if Gitlab::Metrics.enabled?
...
@@ -98,6 +99,17 @@ 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
end
end
GC
::
Profiler
.
enable
GC
::
Profiler
.
enable
...
...
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