debian-mirror-gitlab/spec/support/memory_instrumentation_helper.rb

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

15 lines
537 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
# Memory instrumentation can only be done if running on a valid Ruby
#
# This concept is currently tried to be upstreamed here:
# - https://github.com/ruby/ruby/pull/3978
module MemoryInstrumentationHelper
2023-03-04 22:38:38 +05:30
def verify_memory_instrumentation_available!
2021-03-11 19:13:27 +05:30
return if ::Gitlab::Memory::Instrumentation.available?
2023-03-04 22:38:38 +05:30
raise 'Ruby is missing a required patch that enables memory instrumentation. ' \
2021-03-11 19:13:27 +05:30
'More information can be found here: https://gitlab.com/gitlab-org/gitlab/-/issues/296530.'
end
end