Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-15 21:09:37 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-15 21:09:37 +0300
commitd811b6d8f61b45cd12f94251abff9102b8cefc19 (patch)
tree064f5bdcf19c1480959ff02b752ab8fafa46c0fc /lib/gitlab/memory
parent1581767ea15fcfa63919d39c0d3579da0a4de96e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/memory')
-rw-r--r--lib/gitlab/memory/instrumentation.rb17
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