summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-06-13 13:49:40 +0000
committerRémy Coutable <remy@rymai.me>2016-06-13 13:49:40 +0000
commitb080d88a6bf7c3873b4b74acb5367bb93931210d (patch)
tree5de1788d9ee7bd26093f64d49e8bf14a5873c6b1
parentaa48eeef17e9bceff4e198815f8f1b566fdaf84f (diff)
parentffd316483ce01591e84996dfaedd539480226e5a (diff)
downloadgitlab-ce-b080d88a6bf7c3873b4b74acb5367bb93931210d.tar.gz
Merge branch 'instrument-reference-parsers' into 'master'
Instrument all Banzai::ReferenceParser classes ## What does this MR do? This MR instruments all the classes in the `Banzai::ReferenceParser` namespace. ## Are there points in the code the reviewer needs to double check? No. ## Why was this MR needed? The classes in question weren't instrumented meaning we have no idea how they're performing in production. ## What are the relevant issue numbers? None. ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~ - [ ] ~~API support added~~ - [ ] ~~Tests~~ - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !4620
-rw-r--r--CHANGELOG1
-rw-r--r--config/initializers/metrics.rb17
2 files changed, 12 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 23292cb3ddb..546aaaae0c9 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -70,6 +70,7 @@ v 8.9.0 (unreleased)
- Improved UX of date pickers on issue & milestone forms
- Cache on the database if a project has an active external issue tracker.
- Put project Labels and Milestones pages links under Issues and Merge Requests tabs as subnav
+ - All classes in the Banzai::ReferenceParser namespace are now instrumented
v 8.8.5 (unreleased)
- Ensure branch cleanup regardless of whether the GitHub import process succeeds
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index 2673093b96a..f6509ee43f1 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -96,13 +96,18 @@ if Gitlab::Metrics.enabled?
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)
+ # Instruments all Banzai filters and reference parsers
+ {
+ Filter: Rails.root.join('lib', 'banzai', 'filter', '*.rb'),
+ ReferenceParser: Rails.root.join('lib', 'banzai', 'reference_parser', '*.rb')
+ }.each do |const_name, path|
+ Dir[path].each do |file|
+ klass = File.basename(file, File.extname(file)).camelize
+ const = Banzai.const_get(const_name).const_get(klass)
- config.instrument_methods(const)
- config.instrument_instance_methods(const)
+ config.instrument_methods(const)
+ config.instrument_instance_methods(const)
+ end
end
config.instrument_methods(Banzai::Renderer)