diff options
author | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-07 21:49:44 +0300 |
---|---|---|
committer | Pawel Chojnacki <pawel@chojnacki.ws> | 2017-12-12 20:38:28 +0300 |
commit | 53dc9e83c34b2a0ee2651046de031566f5b925d2 (patch) | |
tree | 68dc8aeacf6b26a289069b2c2e7e807b6e680f75 /lib | |
parent | ad1c186ed386afab578668ccdc21cb02354c81bc (diff) |
Cache feature check for 5 minutes for MethodCall instrumentation toggle
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/metrics/method_call.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/gitlab/metrics/method_call.rb b/lib/gitlab/metrics/method_call.rb index 65d55576ac2..ab7e7a06a77 100644 --- a/lib/gitlab/metrics/method_call.rb +++ b/lib/gitlab/metrics/method_call.rb @@ -72,7 +72,9 @@ module Gitlab end def call_measurement_enabled? - Feature.get(:prometheus_metrics_method_instrumentation).enabled? + Rails.cache.fetch(:prometheus_metrics_method_instrumentation_enabled, expires_in: 5.minutes) do + Feature.get(:prometheus_metrics_method_instrumentation).enabled? + end end end end |