summaryrefslogtreecommitdiff
path: root/lib/gitlab/memory/reports/jemalloc_stats.rb
blob: cfda409594f30141cf5045d890bedcbba916a483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

module Gitlab
  module Memory
    module Reports
      class JemallocStats
        def name
          'jemalloc_stats'
        end

        def run(writer)
          return unless active?

          Gitlab::Memory::Jemalloc.dump_stats(writer)
        end

        def active?
          Feature.enabled?(:report_jemalloc_stats, type: :ops)
        end
      end
    end
  end
end