Module: Gitlab::Ci::Parsers::Instrumentation

Defined in:
lib/gitlab/ci/parsers/instrumentation.rb

Constant Summary collapse

BUCKETS =
[0.25, 1, 5, 10].freeze

Instance Method Summary collapse

Instance Method Details

#parse!(*args) ⇒ Object


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/gitlab/ci/parsers/instrumentation.rb', line 9

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