summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-04-11 17:42:12 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2016-04-11 17:43:12 +0200
commit935f913165b91467a70d9ba2b0ea29fad467db9d (patch)
treebe777e1425f84e336b529ed24afdea176af0baf9 /config
parent15cbbd09fbd05cfd2447dfb43d66d7a96a708f82 (diff)
downloadgitlab-ce-935f913165b91467a70d9ba2b0ea29fad467db9d.tar.gz
Instrument Banzai code
Diffstat (limited to 'config')
-rw-r--r--config/initializers/metrics.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index a9fc38fb04a..1b445bbbd10 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -75,6 +75,29 @@ if Gitlab::Metrics.enabled?
config.instrument_methods(const)
config.instrument_instance_methods(const)
end
+
+ # Instruments all Banzai filters
+ Dir[Rails.root.join('lib', 'banzai', 'filter', '*.rb')].each do |file|
+ klass = File.basename(file, File.extname(file)).camelize
+ const = Banzai::Filter.const_get(klass)
+
+ config.instrument_methods(const)
+ config.instrument_instance_methods(const)
+ end
+
+ config.instrument_methods(Banzai::ReferenceExtractor)
+ config.instrument_instance_methods(Banzai::ReferenceExtractor)
+
+ config.instrument_methods(Banzai::Renderer)
+ config.instrument_methods(Banzai::Querying)
+
+ [Issuable, Mentionable, Participable].each do |klass|
+ config.instrument_instance_methods(klass)
+ config.instrument_instance_methods(klass::ClassMethods)
+ end
+
+ config.instrument_methods(Gitlab::ReferenceExtractor)
+ config.instrument_instance_methods(Gitlab::ReferenceExtractor)
end
GC::Profiler.enable