gitlab-exporter 15.4.0 → 15.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/gitlab-exporter.gemspec +1 -1
- data/lib/gitlab_exporter/database/ci_builds.rb +17 -17
- data/lib/gitlab_exporter/version.rb +1 -1
- data/spec/database/ci_builds_spec.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be5eae9de48805398cb677af26e8b81df7435975413610d772873982e9169ca0
|
4
|
+
data.tar.gz: 56d752f6f03d1624ac336d98565a198b7eee29a237b38e11c920aceda4eee7e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08ce3e0e1a87ff46fc48e69ec458ae795a2ed2e117c4ccdc05c4fd036051d56e73bc8edd9ae270e7a52b9fa012c5c8f343595ffd1a8da55e3dfa468b9d4f1127'
|
7
|
+
data.tar.gz: ab467b4ae68d9a8b3bc5ea7a68d0130378b5859cee0160079aff9aac7f3bb6e48b609d213d558965c0badffcedddc3b8926921c059f765263a5d6ef23ab8132a
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-exporter (15.
|
4
|
+
gitlab-exporter (15.6.0)
|
5
5
|
connection_pool (= 2.2.5)
|
6
6
|
deep_merge (~> 1.2.2)
|
7
7
|
faraday (>= 1.8.0, <= 2.8.1)
|
8
|
-
pg (= 1.5.
|
8
|
+
pg (= 1.5.9)
|
9
9
|
puma (= 5.6.8)
|
10
10
|
quantile (= 0.2.1)
|
11
11
|
redis (= 4.5.0)
|
@@ -33,7 +33,7 @@ GEM
|
|
33
33
|
parallel (1.20.1)
|
34
34
|
parser (3.0.0.0)
|
35
35
|
ast (~> 2.4.1)
|
36
|
-
pg (1.5.
|
36
|
+
pg (1.5.9)
|
37
37
|
puma (5.6.8)
|
38
38
|
nio4r (~> 2.0)
|
39
39
|
quantile (0.2.1)
|
data/gitlab-exporter.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |s|
|
|
25
25
|
# Lock to 2.8.1 until RubyGems 3.5.5 is shipped with the fix for
|
26
26
|
# https://github.com/rubygems/rubygems/issues/7374
|
27
27
|
s.add_runtime_dependency "faraday", [">= 1.8.0", "<= 2.8.1"]
|
28
|
-
s.add_runtime_dependency "pg", "1.5.
|
28
|
+
s.add_runtime_dependency "pg", "1.5.9"
|
29
29
|
s.add_runtime_dependency "puma", "5.6.8"
|
30
30
|
s.add_runtime_dependency "quantile", "0.2.1"
|
31
31
|
s.add_runtime_dependency "redis", "4.5.0"
|
@@ -78,8 +78,8 @@ module GitLab
|
|
78
78
|
projects.namespace_id,
|
79
79
|
projects.mirror,
|
80
80
|
projects.mirror_trigger_builds,
|
81
|
-
|
82
|
-
|
81
|
+
p_ci_pipelines.pipeline_schedule_id,
|
82
|
+
p_ci_pipelines.trigger_id,
|
83
83
|
(COALESCE(namespaces.shared_runners_minutes_limit, application_settings.shared_runners_minutes, 0) = 0 OR
|
84
84
|
COALESCE(namespace_statistics.shared_runners_seconds, 0) < COALESCE(namespaces.shared_runners_minutes_limit, application_settings.shared_runners_minutes, 0) * 60) as has_minutes,
|
85
85
|
COUNT(*) AS count
|
@@ -88,8 +88,8 @@ module GitLab
|
|
88
88
|
ON ci_runners.id = p_ci_builds.runner_id
|
89
89
|
JOIN projects
|
90
90
|
ON projects.id = p_ci_builds.project_id
|
91
|
-
JOIN
|
92
|
-
ON
|
91
|
+
JOIN p_ci_pipelines
|
92
|
+
ON p_ci_pipelines.id = p_ci_builds.commit_id
|
93
93
|
JOIN namespaces
|
94
94
|
ON namespaces.id = projects.namespace_id
|
95
95
|
LEFT JOIN namespace_statistics
|
@@ -106,8 +106,8 @@ module GitLab
|
|
106
106
|
projects.namespace_id,
|
107
107
|
projects.mirror,
|
108
108
|
projects.mirror_trigger_builds,
|
109
|
-
|
110
|
-
|
109
|
+
p_ci_pipelines.pipeline_schedule_id,
|
110
|
+
p_ci_pipelines.trigger_id,
|
111
111
|
namespaces.shared_runners_minutes_limit,
|
112
112
|
namespace_statistics.shared_runners_seconds,
|
113
113
|
application_settings.shared_runners_minutes
|
@@ -119,16 +119,16 @@ module GitLab
|
|
119
119
|
p_ci_builds.runner_id,
|
120
120
|
ci_runners.runner_type,
|
121
121
|
projects.namespace_id,
|
122
|
-
|
123
|
-
|
122
|
+
p_ci_pipelines.pipeline_schedule_id,
|
123
|
+
p_ci_pipelines.trigger_id,
|
124
124
|
COUNT(*) AS count
|
125
125
|
FROM p_ci_builds
|
126
126
|
JOIN ci_runners
|
127
127
|
ON ci_runners.id = p_ci_builds.runner_id
|
128
128
|
JOIN projects
|
129
129
|
ON projects.id = p_ci_builds.project_id
|
130
|
-
JOIN
|
131
|
-
ON
|
130
|
+
JOIN p_ci_pipelines
|
131
|
+
ON p_ci_pipelines.id = p_ci_builds.commit_id
|
132
132
|
WHERE p_ci_builds.type = 'Ci::Build'
|
133
133
|
AND p_ci_builds.status = 'running'
|
134
134
|
-- The created_at filter has been introduced for performance reasons only
|
@@ -138,8 +138,8 @@ module GitLab
|
|
138
138
|
p_ci_builds.runner_id,
|
139
139
|
ci_runners.runner_type,
|
140
140
|
projects.namespace_id,
|
141
|
-
|
142
|
-
|
141
|
+
p_ci_pipelines.pipeline_schedule_id,
|
142
|
+
p_ci_pipelines.trigger_id
|
143
143
|
SQL
|
144
144
|
|
145
145
|
EE_CHECK_QUERY =
|
@@ -154,13 +154,13 @@ module GitLab
|
|
154
154
|
FROM p_ci_builds
|
155
155
|
JOIN ci_build_trace_chunks
|
156
156
|
ON ci_build_trace_chunks.build_id = p_ci_builds.id
|
157
|
-
LEFT JOIN
|
158
|
-
ON
|
159
|
-
AND
|
157
|
+
LEFT JOIN p_ci_job_artifacts
|
158
|
+
ON p_ci_job_artifacts.job_id = p_ci_builds.id
|
159
|
+
AND p_ci_job_artifacts.file_type = 3
|
160
160
|
WHERE p_ci_builds.type = 'Ci::Build'
|
161
161
|
AND p_ci_builds.status IN ('success', 'failed', 'canceled')
|
162
162
|
AND p_ci_builds.finished_at < '%s'
|
163
|
-
AND
|
163
|
+
AND p_ci_job_artifacts.job_id IS NULL
|
164
164
|
SQL
|
165
165
|
|
166
166
|
STATUS_CREATED = "created".freeze
|
@@ -234,7 +234,7 @@ module GitLab
|
|
234
234
|
runner_type: row["runner_type"],
|
235
235
|
namespace: row["namespace_id"].to_s,
|
236
236
|
scheduled: row["pipeline_schedule_id"] ? "yes" : "no",
|
237
|
-
triggered: row["
|
237
|
+
triggered: row["trigger_id"] ? "yes" : "no",
|
238
238
|
value: row["count"].to_i }
|
239
239
|
include_ee_fields(values, row)
|
240
240
|
end
|
@@ -40,8 +40,8 @@ describe GitLab::Exporter::Database do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# rubocop:disable Metrics/ParameterLists
|
43
|
-
def per_runner_query_row_ee(runner_id, runner_type, namespace_id, mirror, mirror_trigger_builds, pipeline_schedule_id,
|
44
|
-
row = per_runner_query_row_ce(runner_id, runner_type, namespace_id, pipeline_schedule_id,
|
43
|
+
def per_runner_query_row_ee(runner_id, runner_type, namespace_id, mirror, mirror_trigger_builds, pipeline_schedule_id, trigger_id, has_minutes, count)
|
44
|
+
row = per_runner_query_row_ce(runner_id, runner_type, namespace_id, pipeline_schedule_id, trigger_id, count)
|
45
45
|
row["mirror"] = mirror
|
46
46
|
row["mirror_trigger_builds"] = mirror_trigger_builds
|
47
47
|
row["has_minutes"] = has_minutes
|
@@ -50,12 +50,12 @@ describe GitLab::Exporter::Database do
|
|
50
50
|
# rubocop:enable Metrics/ParameterLists
|
51
51
|
|
52
52
|
# rubocop:disable Metrics/ParameterLists
|
53
|
-
def per_runner_query_row_ce(runner_id, runner_type, namespace_id, pipeline_schedule_id,
|
53
|
+
def per_runner_query_row_ce(runner_id, runner_type, namespace_id, pipeline_schedule_id, trigger_id, count)
|
54
54
|
{ "runner_id" => runner_id,
|
55
55
|
"runner_type" => runner_type,
|
56
56
|
"namespace_id" => namespace_id,
|
57
57
|
"pipeline_schedule_id" => pipeline_schedule_id,
|
58
|
-
"
|
58
|
+
"trigger_id" => trigger_id,
|
59
59
|
"count" => count }
|
60
60
|
end
|
61
61
|
# rubocop:enable Metrics/ParameterLists
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-exporter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 15.
|
4
|
+
version: 15.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pablo Carranza
|
@@ -64,14 +64,14 @@ dependencies:
|
|
64
64
|
requirements:
|
65
65
|
- - '='
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: 1.5.
|
67
|
+
version: 1.5.9
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - '='
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: 1.5.
|
74
|
+
version: 1.5.9
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: puma
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|