debian-mirror-gitlab/lib/gitlab/memory/reports/heap_dump.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
602 B
Ruby
Raw Normal View History

2023-03-04 22:38:38 +05:30
# frozen_string_literal: true
module Gitlab
module Memory
module Reports
class HeapDump
class << self
def enqueue!
@write_heap_dump = true
end
def enqueued?
!!@write_heap_dump
end
end
def name
'heap_dump'
end
def active?
Feature.enabled?(:report_heap_dumps, type: :ops)
end
def run(writer)
return false unless self.class.enqueued?
ObjectSpace.dump_all(output: writer)
true
end
end
end
end
end