gitlab-exporter 13.4.1 → 13.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gitlab_exporter/database/ci_builds.rb +47 -47
- data/lib/gitlab_exporter/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71244a8992a3116e4513746514842e6d6f0c53abbef7e0a7435a3889acce66c1
|
4
|
+
data.tar.gz: fc013ec18e7f7a11e3d5da3a1375fe80add92f96da1f572eb8b577ee98bedebb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4d3c84092ca842c13123bb6573118adc44b60f090594db51b559bc20d2718c1e8a341494fd6ba376e6a30ce07985b2ae88923e7a68760a631936f3e962ed62f
|
7
|
+
data.tar.gz: eb579c03705bdbd4d64b5c0a5b6dc40cbfa0125939b03d250d6efe44f395fe55effabbf3733ab57a0297494530ce8efc5b3521eda12c930b7ec8ffeadc8fb7b0
|
data/Gemfile.lock
CHANGED
@@ -9,27 +9,27 @@ module GitLab
|
|
9
9
|
<<~SQL.freeze
|
10
10
|
SELECT
|
11
11
|
projects.namespace_id,
|
12
|
-
|
12
|
+
p_ci_builds.status,
|
13
13
|
projects.shared_runners_enabled,
|
14
14
|
(COALESCE(namespaces.shared_runners_minutes_limit, application_settings.shared_runners_minutes, 0) = 0 OR
|
15
15
|
COALESCE(namespace_statistics.shared_runners_seconds, 0) < COALESCE(namespaces.shared_runners_minutes_limit, application_settings.shared_runners_minutes, 0) * 60) as has_minutes,
|
16
16
|
COUNT(*) AS count
|
17
|
-
FROM
|
17
|
+
FROM p_ci_builds
|
18
18
|
JOIN projects
|
19
|
-
ON projects.id =
|
19
|
+
ON projects.id = p_ci_builds.project_id
|
20
20
|
JOIN namespaces
|
21
21
|
ON namespaces.id = projects.namespace_id
|
22
22
|
LEFT JOIN namespace_statistics
|
23
23
|
ON namespace_statistics.namespace_id = namespaces.id
|
24
24
|
JOIN application_settings ON (TRUE)
|
25
|
-
WHERE
|
26
|
-
AND
|
25
|
+
WHERE p_ci_builds.type = 'Ci::Build'
|
26
|
+
AND p_ci_builds.status = '%s'
|
27
27
|
-- The created_at filter has been introduced for performance reasons only
|
28
|
-
AND
|
28
|
+
AND p_ci_builds.created_at > NOW() - INTERVAL '7 days'
|
29
29
|
AND projects.pending_delete = 'f'
|
30
30
|
GROUP BY
|
31
31
|
projects.namespace_id,
|
32
|
-
|
32
|
+
p_ci_builds.status,
|
33
33
|
projects.shared_runners_enabled,
|
34
34
|
namespaces.shared_runners_minutes_limit,
|
35
35
|
namespace_statistics.shared_runners_seconds,
|
@@ -40,20 +40,20 @@ module GitLab
|
|
40
40
|
<<~SQL.freeze
|
41
41
|
SELECT
|
42
42
|
projects.namespace_id,
|
43
|
-
|
43
|
+
p_ci_builds.status,
|
44
44
|
projects.shared_runners_enabled,
|
45
45
|
COUNT(*) AS count
|
46
|
-
FROM
|
46
|
+
FROM p_ci_builds
|
47
47
|
JOIN projects
|
48
|
-
ON projects.id =
|
49
|
-
WHERE
|
50
|
-
AND
|
48
|
+
ON projects.id = p_ci_builds.project_id
|
49
|
+
WHERE p_ci_builds.type = 'Ci::Build'
|
50
|
+
AND p_ci_builds.status = '%s'
|
51
51
|
-- The created_at filter has been introduced for performance reasons only
|
52
|
-
AND
|
52
|
+
AND p_ci_builds.created_at > NOW() - INTERVAL '7 days'
|
53
53
|
AND projects.pending_delete = 'f'
|
54
54
|
GROUP BY
|
55
55
|
projects.namespace_id,
|
56
|
-
|
56
|
+
p_ci_builds.status,
|
57
57
|
projects.shared_runners_enabled
|
58
58
|
SQL
|
59
59
|
|
@@ -61,53 +61,53 @@ module GitLab
|
|
61
61
|
<<~SQL.freeze
|
62
62
|
SELECT
|
63
63
|
COUNT(*) AS count
|
64
|
-
FROM
|
64
|
+
FROM p_ci_builds
|
65
65
|
JOIN projects
|
66
|
-
ON projects.id =
|
67
|
-
WHERE
|
68
|
-
AND
|
69
|
-
AND
|
66
|
+
ON projects.id = p_ci_builds.project_id
|
67
|
+
WHERE p_ci_builds.type = 'Ci::Build'
|
68
|
+
AND p_ci_builds.status = 'running'
|
69
|
+
AND p_ci_builds.updated_at < NOW() - INTERVAL '1 hour'
|
70
70
|
AND projects.pending_delete = 'f'
|
71
71
|
SQL
|
72
72
|
|
73
73
|
PER_RUNNER_QUERY_EE =
|
74
74
|
<<~SQL.freeze
|
75
75
|
SELECT
|
76
|
-
|
76
|
+
p_ci_builds.runner_id,
|
77
77
|
ci_runners.runner_type,
|
78
78
|
projects.namespace_id,
|
79
79
|
projects.mirror,
|
80
80
|
projects.mirror_trigger_builds,
|
81
81
|
ci_pipelines.pipeline_schedule_id,
|
82
|
-
|
82
|
+
p_ci_builds.trigger_request_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
|
86
|
-
FROM
|
86
|
+
FROM p_ci_builds
|
87
87
|
JOIN ci_runners
|
88
|
-
ON ci_runners.id =
|
88
|
+
ON ci_runners.id = p_ci_builds.runner_id
|
89
89
|
JOIN projects
|
90
|
-
ON projects.id =
|
90
|
+
ON projects.id = p_ci_builds.project_id
|
91
91
|
JOIN ci_pipelines
|
92
|
-
ON ci_pipelines.id =
|
92
|
+
ON 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
|
96
96
|
ON namespace_statistics.namespace_id = namespaces.id
|
97
97
|
JOIN application_settings ON (TRUE)
|
98
|
-
WHERE
|
99
|
-
AND
|
98
|
+
WHERE p_ci_builds.type = 'Ci::Build'
|
99
|
+
AND p_ci_builds.status = 'running'
|
100
100
|
-- The created_at filter has been introduced for performance reasons only
|
101
|
-
AND
|
101
|
+
AND p_ci_builds.created_at > NOW() - INTERVAL '7 days'
|
102
102
|
AND projects.pending_delete = 'f'
|
103
103
|
GROUP BY
|
104
|
-
|
104
|
+
p_ci_builds.runner_id,
|
105
105
|
ci_runners.runner_type,
|
106
106
|
projects.namespace_id,
|
107
107
|
projects.mirror,
|
108
108
|
projects.mirror_trigger_builds,
|
109
109
|
ci_pipelines.pipeline_schedule_id,
|
110
|
-
|
110
|
+
p_ci_builds.trigger_request_id,
|
111
111
|
namespaces.shared_runners_minutes_limit,
|
112
112
|
namespace_statistics.shared_runners_seconds,
|
113
113
|
application_settings.shared_runners_minutes
|
@@ -116,30 +116,30 @@ module GitLab
|
|
116
116
|
PER_RUNNER_QUERY_CE =
|
117
117
|
<<~SQL.freeze
|
118
118
|
SELECT
|
119
|
-
|
119
|
+
p_ci_builds.runner_id,
|
120
120
|
ci_runners.runner_type,
|
121
121
|
projects.namespace_id,
|
122
122
|
ci_pipelines.pipeline_schedule_id,
|
123
|
-
|
123
|
+
p_ci_builds.trigger_request_id,
|
124
124
|
COUNT(*) AS count
|
125
|
-
FROM
|
125
|
+
FROM p_ci_builds
|
126
126
|
JOIN ci_runners
|
127
|
-
ON ci_runners.id =
|
127
|
+
ON ci_runners.id = p_ci_builds.runner_id
|
128
128
|
JOIN projects
|
129
|
-
ON projects.id =
|
129
|
+
ON projects.id = p_ci_builds.project_id
|
130
130
|
JOIN ci_pipelines
|
131
|
-
ON ci_pipelines.id =
|
132
|
-
WHERE
|
133
|
-
AND
|
131
|
+
ON ci_pipelines.id = p_ci_builds.commit_id
|
132
|
+
WHERE p_ci_builds.type = 'Ci::Build'
|
133
|
+
AND p_ci_builds.status = 'running'
|
134
134
|
-- The created_at filter has been introduced for performance reasons only
|
135
|
-
AND
|
135
|
+
AND p_ci_builds.created_at > NOW() - INTERVAL '7 days'
|
136
136
|
AND projects.pending_delete = 'f'
|
137
137
|
GROUP BY
|
138
|
-
|
138
|
+
p_ci_builds.runner_id,
|
139
139
|
ci_runners.runner_type,
|
140
140
|
projects.namespace_id,
|
141
141
|
ci_pipelines.pipeline_schedule_id,
|
142
|
-
|
142
|
+
p_ci_builds.trigger_request_id
|
143
143
|
SQL
|
144
144
|
|
145
145
|
EE_CHECK_QUERY =
|
@@ -151,15 +151,15 @@ module GitLab
|
|
151
151
|
<<~SQL.freeze
|
152
152
|
SELECT
|
153
153
|
COUNT(*) as count
|
154
|
-
FROM
|
154
|
+
FROM p_ci_builds
|
155
155
|
JOIN ci_build_trace_chunks
|
156
|
-
ON ci_build_trace_chunks.build_id =
|
156
|
+
ON ci_build_trace_chunks.build_id = p_ci_builds.id
|
157
157
|
LEFT JOIN ci_job_artifacts
|
158
|
-
ON ci_job_artifacts.job_id =
|
158
|
+
ON ci_job_artifacts.job_id = p_ci_builds.id
|
159
159
|
AND ci_job_artifacts.file_type = 3
|
160
|
-
WHERE
|
161
|
-
AND
|
162
|
-
AND
|
160
|
+
WHERE p_ci_builds.type = 'Ci::Build'
|
161
|
+
AND p_ci_builds.status IN ('success', 'failed', 'canceled')
|
162
|
+
AND p_ci_builds.finished_at < '%s'
|
163
163
|
AND ci_job_artifacts.job_id IS NULL
|
164
164
|
SQL
|
165
165
|
|