diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2016-07-25 16:45:04 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2016-07-25 16:45:42 +0300 |
commit | 67012f4ae0c914473162d3d84d62e96dad2b3fc4 (patch) | |
tree | 174c80b942d8bdfa8bd00f561c471db5fa7a88fc /config/initializers | |
parent | 8987257498c785e1ecf90c6cb85b9d1db06d9797 (diff) |
Instrument Nokogiri parsing methods
This allows us to see how much time is being spent in just parsing
HTML/XML documents.
Diffstat (limited to 'config/initializers')
-rw-r--r-- | config/initializers/metrics.rb | 7 |
1 files changed, 7 insertions, 0 deletions
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 |