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

metrics.rb « pipeline « ci « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 6cb6fd3920d99cce70d9e63e86984f6bab3933ee (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# frozen_string_literal: true

module Gitlab
  module Ci
    module Pipeline
      class Metrics
        def self.pipeline_creation_duration_histogram
          name = :gitlab_ci_pipeline_creation_duration_seconds
          comment = 'Pipeline creation duration'
          labels = {}
          buckets = [0.01, 0.05, 0.1, 0.5, 1.0, 2.0, 5.0, 20.0, 50.0, 240.0]

          ::Gitlab::Metrics.histogram(name, comment, labels, buckets)
        end

        def self.pipeline_size_histogram
          name = :gitlab_ci_pipeline_size_builds
          comment = 'Pipeline size'
          labels = { source: nil }
          buckets = [0, 1, 5, 10, 20, 50, 100, 200, 500, 1000]

          ::Gitlab::Metrics.histogram(name, comment, labels, buckets)
        end

        def self.pipeline_processing_events_counter
          name = :gitlab_ci_pipeline_processing_events_total
          comment = 'Total amount of pipeline processing events'

          Gitlab::Metrics.counter(name, comment)
        end

        def self.pipelines_created_counter
          name = :pipelines_created_total
          comment = 'Counter of pipelines created'

          Gitlab::Metrics.counter(name, comment)
        end

        def self.legacy_update_jobs_counter
          name = :ci_legacy_update_jobs_as_retried_total
          comment = 'Counter of occurrences when jobs were not being set as retried before update_retried'

          Gitlab::Metrics.counter(name, comment)
        end

        def self.pipeline_failure_reason_counter
          name = :gitlab_ci_pipeline_failure_reasons
          comment = 'Counter of pipeline failure reasons'

          Gitlab::Metrics.counter(name, comment)
        end

        def self.job_failure_reason_counter
          name = :gitlab_ci_job_failure_reasons
          comment = 'Counter of job failure reasons'

          Gitlab::Metrics.counter(name, comment)
        end
      end
    end
  end
end