Skip to content
Snippets Groups Projects
Verified Commit 82991293 authored by Yorick Peterse's avatar Yorick Peterse
Browse files

Instrument all service classes

Fixes gitlab-org/gitlab-ce#15162
parent 8cb41f19
Branches
Tags
1 merge request!3675Instrument all service classes
Pipeline #
if Gitlab::Metrics.enabled?
require 'pathname'
require 'influxdb'
require 'connection_pool'
require 'method_source'
Loading
Loading
@@ -98,6 +99,17 @@ 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
end
 
GC::Profiler.enable
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment