Welcome to mirror list, hosted at ThFree Co, Russian Federation.

instrumentation.rb « parsers « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ab4a923d9aa6a1b1bbf3706d9356a843cf2e05fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# frozen_string_literal: true

module Gitlab
  module Ci
    module Parsers
      module Instrumentation
        BUCKETS = [0.25, 1, 5, 10].freeze

        def parse!(*args)
          parser_result = nil

          duration = Benchmark.realtime do
            parser_result = super
          end

          labels = {}

          histogram = Gitlab::Metrics.histogram(
            :ci_report_parser_duration_seconds,
            'Duration of parsing a CI report artifact',
            labels,
            BUCKETS
          )

          histogram.observe({ parser: self.class.name }, duration)

          parser_result
        end
      end
    end
  end
end