2022-08-27 11:52:29 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Memory
|
|
|
|
module Reports
|
|
|
|
class JemallocStats
|
2023-03-04 22:38:38 +05:30
|
|
|
def name
|
|
|
|
'jemalloc_stats'
|
2022-08-27 11:52:29 +05:30
|
|
|
end
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
def run(writer)
|
2022-08-27 11:52:29 +05:30
|
|
|
return unless active?
|
|
|
|
|
2023-03-04 22:38:38 +05:30
|
|
|
Gitlab::Memory::Jemalloc.dump_stats(writer)
|
2022-08-27 11:52:29 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def active?
|
|
|
|
Feature.enabled?(:report_jemalloc_stats, type: :ops)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|