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

module Gitlab
  module Instrumentation
    module Storage
      extend self

      delegate :active?, to: ::Gitlab::SafeRequestStore
      delegate :[], :[]=, to: :storage

      def clear!
        storage.clear
      end

      private

      def storage
        ::Gitlab::SafeRequestStore.fetch(:instrumentation) { {} }
      end
    end
  end
end