diff options
Diffstat (limited to 'lib/gitlab/memory/instrumentation.rb')
-rw-r--r-- | lib/gitlab/memory/instrumentation.rb | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/gitlab/memory/instrumentation.rb b/lib/gitlab/memory/instrumentation.rb index e800fe14cf1..4e93d6a9ece 100644 --- a/lib/gitlab/memory/instrumentation.rb +++ b/lib/gitlab/memory/instrumentation.rb @@ -21,24 +21,13 @@ module Gitlab Thread.current.respond_to?(:memory_allocations) end - # This method changes a global state - def self.ensure_feature_flag! + def self.start_thread_memory_allocations return unless available? - enabled = Feature.enabled?(:trace_memory_allocations, default_enabled: true) - return if enabled == Thread.trace_memory_allocations - MUTEX.synchronize do - # This enables or disables feature dynamically - # based on a feature flag - Thread.trace_memory_allocations = enabled + # This method changes a global state + Thread.trace_memory_allocations = true end - end - - def self.start_thread_memory_allocations - return unless available? - - ensure_feature_flag! # it will return `nil` if disabled Thread.current.memory_allocations |