Class: Gitlab::Ci::Pipeline::Metrics

Inherits:
Object
  • Object
show all
Includes:
Utils::StrongMemoize
Defined in:
lib/gitlab/ci/pipeline/metrics.rb

Instance Method Summary collapse

Methods included from Utils::StrongMemoize

#clear_memoization, #strong_memoize, #strong_memoized?

Instance Method Details

#pipeline_creation_duration_histogramObject


9
10
11
12
13
14
15
16
17
18
# File 'lib/gitlab/ci/pipeline/metrics.rb', line 9

def pipeline_creation_duration_histogram
  strong_memoize(:pipeline_creation_duration_histogram) do
    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
end

#pipeline_processing_events_counterObject


31
32
33
34
35
36
37
38
# File 'lib/gitlab/ci/pipeline/metrics.rb', line 31

def pipeline_processing_events_counter
  strong_memoize(:pipeline_processing_events_counter) do
    name = :gitlab_ci_pipeline_processing_events_total
    comment = 'Total amount of pipeline processing events'

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

#pipeline_size_histogramObject


20
21
22
23
24
25
26
27
28
29
# File 'lib/gitlab/ci/pipeline/metrics.rb', line 20

def pipeline_size_histogram
  strong_memoize(:pipeline_size_histogram) do
    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
end

#pipelines_created_counterObject


40
41
42
43
44
45
46
47
# File 'lib/gitlab/ci/pipeline/metrics.rb', line 40

def pipelines_created_counter
  strong_memoize(:pipelines_created_count) do
    name = :pipelines_created_total
    comment = 'Counter of pipelines created'

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