diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-15 18:38:25 +0300 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2015-12-17 19:25:48 +0300 |
commit | a41287d8989d7d49b405fd8f658d6c6e4edfd307 (patch) | |
tree | 283b85ee5892e999e029afdf035c7713e2dcdc0d /lib/gitlab/metrics.rb | |
parent | 13dbd663acbbe91ddac77b650a90377cd12c54b8 (diff) |
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.rb | 4 |
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 |