summaryrefslogtreecommitdiff
path: root/lib/gitlab/metrics.rb
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2015-12-15 16:38:25 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2015-12-17 17:25:48 +0100
commita41287d8989d7d49b405fd8f658d6c6e4edfd307 (patch)
tree283b85ee5892e999e029afdf035c7713e2dcdc0d /lib/gitlab/metrics.rb
parent13dbd663acbbe91ddac77b650a90377cd12c54b8 (diff)
downloadgitlab-ce-a41287d8989d7d49b405fd8f658d6c6e4edfd307.tar.gz
Only track method calls above a certain threshold
This ensures we don't end up wasting resources by tracking method calls that only take a few microseconds. By default the threshold is 10 milliseconds but this can be changed using the gitlab.yml configuration file.
Diffstat (limited to 'lib/gitlab/metrics.rb')
-rw-r--r--lib/gitlab/metrics.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/gitlab/metrics.rb b/lib/gitlab/metrics.rb
index 007429fa194..4b92c3244fa 100644
--- a/lib/gitlab/metrics.rb
+++ b/lib/gitlab/metrics.rb
@@ -16,6 +16,10 @@ module Gitlab
!!Settings.metrics['enabled']
end
+ def self.method_call_threshold
+ Settings.metrics['method_call_threshold'] || 10
+ end
+
def self.pool
@pool
end