summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2016-02-02 10:07:59 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-02-02 10:07:59 +0000
commit494028445b2d63fbcb62b1ddc8260574e374505c (patch)
treefedf21ba7741e88f87671caeed3af5e230c6d2c8
parent7df149bb63c91792fb958db87b24bb120463a49e (diff)
parent33fb55a572364feca70fcc0f15b80da6176f4d71 (diff)
downloadgitlab-ce-494028445b2d63fbcb62b1ddc8260574e374505c.tar.gz
Merge branch 'expand-git-instrumentation' into 'master'
Expand Git instrumentation This instruments some extra `Gitlab::Git` code as well as a collection of `Rugged` constants. See merge request !2664
-rw-r--r--config/initializers/metrics.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index 0945b93ed5d..3e1deb8d306 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -49,12 +49,14 @@ if Gitlab::Metrics.enabled?
config.instrument_instance_methods(Gitlab::Shell)
config.instrument_methods(Gitlab::Git)
- config.instrument_instance_methods(Gitlab::Git::Repository)
Gitlab::Git.constants.each do |name|
const = Gitlab::Git.const_get(name)
- config.instrument_methods(const) if const.is_a?(Module)
+ next unless const.is_a?(Module)
+
+ config.instrument_methods(const)
+ config.instrument_instance_methods(const)
end
Dir[Rails.root.join('app', 'finders', '*.rb')].each do |path|
@@ -62,6 +64,16 @@ if Gitlab::Metrics.enabled?
config.instrument_instance_methods(const)
end
+
+ [
+ :Blame, :Branch, :BranchCollection, :Blob, :Commit, :Diff, :Repository,
+ :Tag, :TagCollection, :Tree
+ ].each do |name|
+ const = Rugged.const_get(name)
+
+ config.instrument_methods(const)
+ config.instrument_instance_methods(const)
+ end
end
GC::Profiler.enable