diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-25 14:31:25 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-25 14:31:25 +0000 |
commit | 720d3be2c4fd4186d320694e869ccf25498edb34 (patch) | |
tree | 174c80b942d8bdfa8bd00f561c471db5fa7a88fc | |
parent | 8987257498c785e1ecf90c6cb85b9d1db06d9797 (diff) | |
parent | 67012f4ae0c914473162d3d84d62e96dad2b3fc4 (diff) | |
download | gitlab-ce-720d3be2c4fd4186d320694e869ccf25498edb34.tar.gz |
Merge branch 'instrument-nokogiri' into 'master'
Instrument Nokogiri parsing methods
## What does this MR do?
This MR instruments the various parsing methods of Nokogiri.
## Are there points in the code the reviewer needs to double check?
No.
## Why was this MR needed?
This allows us to see how much time is spent in Nokogiri.
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- Tests
- [x] ~~Added for this feature/bug~~
- [ ] All builds are passing
- [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 !5470
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | config/initializers/metrics.rb | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/CHANGELOG b/CHANGELOG index 2f9b6e0da24..e741dbf374b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -5,6 +5,7 @@ v 8.11.0 (unreleased) - Fix of 'Commits being passed to custom hooks are already reachable when using the UI' - Limit git rev-list output count to one in forced push check - Retrieve rendered HTML from cache in one request + - Nokogiri's various parsing methods are now instrumented - Make fork counter always clickable !5463 (winniehell) - Load project invited groups and members eagerly in ProjectTeam#fetch_members - Add GitLab Workhorse version to admin dashboard (Katarzyna Kobierska Ula Budziszewska) diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb index c4266ab8ba5..f3cddac5b36 100644 --- a/config/initializers/metrics.rb +++ b/config/initializers/metrics.rb @@ -136,6 +136,13 @@ if Gitlab::Metrics.enabled? config.instrument_instance_methods(Rouge::Plugins::Redcarpet) config.instrument_instance_methods(Rouge::Formatters::HTMLGitlab) + [:XML, :HTML].each do |namespace| + namespace_mod = Nokogiri.const_get(namespace) + + config.instrument_methods(namespace_mod) + config.instrument_methods(namespace_mod::Document) + end + config.instrument_methods(Rinku) end |