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 11:19:51 +0100
commit503ad19336b13e6d382827985f25fbfcb4d47f07 (patch)
tree55df1bc907e10420d07ffb9d7717ac2efa0f0035
parent106722fa39b4e2e225fb8e9427af369a9cbe849c (diff)
downloadgitlab-ce-503ad19336b13e6d382827985f25fbfcb4d47f07.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.rb22
1 files changed, 20 insertions, 2 deletions
diff --git a/config/initializers/metrics.rb b/config/initializers/metrics.rb
index 4bc6d35abfd..3e1deb8d306 100644
--- a/config/initializers/metrics.rb
+++ b/config/initializers/metrics.rb
@@ -49,12 +49,30 @@ 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|
+ const = File.basename(path, '.rb').camelize.constantize
+
+ 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