gitlab-exporter 6.1.0 → 7.0.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 +5 -5
- data/lib/gitlab_exporter/database/row_count.rb +11 -2
- 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: 63b7f7660a9e551506b9e1f9ef5ae509c1af8c93da24e2a9ab32ee1363d29c7b
|
4
|
+
data.tar.gz: f410a4e7c189cbaa3ad2c169955ce2098397f86bd93061fcf6a9b85353ade364
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7c93c493c8da03f94b1cd9786bebc4c83564cb60774a2786b7450faaeec6335d707c3e8f0ab1e6e2bc18466db598441cdfaccd6a4bb7482bdb232412e134cbbd
|
7
|
+
data.tar.gz: 6c406c6bffa5c8c7150e638943e895b3e9272122b5ab81a38cbdedff6a70279af72cc91a0a3de92f0459cb3621cb867927d253ca15e6e2cfc141ee909c79c120
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gitlab-exporter (
|
4
|
+
gitlab-exporter (7.0.0)
|
5
5
|
connection_pool (~> 2.2.1)
|
6
6
|
pg (~> 1.1)
|
7
7
|
quantile (~> 0.2.0)
|
@@ -20,10 +20,10 @@ GEM
|
|
20
20
|
ruby2_keywords (~> 0.0.1)
|
21
21
|
parser (2.5.1.0)
|
22
22
|
ast (~> 2.4.0)
|
23
|
-
pg (1.2.
|
23
|
+
pg (1.2.3)
|
24
24
|
powerpack (0.1.1)
|
25
25
|
quantile (0.2.1)
|
26
|
-
rack (2.
|
26
|
+
rack (2.0.9)
|
27
27
|
rack-protection (2.0.8.1)
|
28
28
|
rack
|
29
29
|
rainbow (2.1.0)
|
@@ -51,9 +51,9 @@ GEM
|
|
51
51
|
unicode-display_width (~> 1.0, >= 1.0.1)
|
52
52
|
ruby-progressbar (1.8.1)
|
53
53
|
ruby2_keywords (0.0.2)
|
54
|
-
sidekiq (5.2.
|
54
|
+
sidekiq (5.2.8)
|
55
55
|
connection_pool (~> 2.2, >= 2.2.2)
|
56
|
-
rack (
|
56
|
+
rack (< 2.1.0)
|
57
57
|
rack-protection (>= 1.5.0)
|
58
58
|
redis (>= 3.3.5, < 5)
|
59
59
|
sinatra (2.0.8.1)
|
@@ -8,6 +8,7 @@ module GitLab
|
|
8
8
|
# This class works under the assumption you do COUNT(*) queries, define
|
9
9
|
# queries in the QUERIES constant. If in doubt how these work, read
|
10
10
|
# #construct_query
|
11
|
+
# rubocop:disable Metrics/ClassLength
|
11
12
|
class RowCountCollector < Base
|
12
13
|
WHERE_MIRROR_ENABLED = <<~SQL.freeze
|
13
14
|
projects.mirror = true
|
@@ -19,8 +20,15 @@ module GitLab
|
|
19
20
|
select: :projects,
|
20
21
|
joins: <<~SQL,
|
21
22
|
INNER JOIN project_mirror_data ON project_mirror_data.project_id = projects.id
|
22
|
-
INNER JOIN namespaces ON
|
23
|
-
|
23
|
+
INNER JOIN namespaces AS root_namespaces ON root_namespaces.id = (
|
24
|
+
WITH RECURSIVE "base_and_ancestors" AS (
|
25
|
+
(SELECT "namespaces".* FROM "namespaces" WHERE "namespaces"."id" = projects.namespace_id)
|
26
|
+
UNION
|
27
|
+
(SELECT "namespaces".* FROM "namespaces", "base_and_ancestors" WHERE "namespaces"."id" = "base_and_ancestors"."parent_id")
|
28
|
+
) SELECT "namespaces".id FROM "base_and_ancestors" AS "namespaces" WHERE "namespaces"."parent_id" IS NULL
|
29
|
+
)
|
30
|
+
LEFT JOIN gitlab_subscriptions ON gitlab_subscriptions.namespace_id = root_namespaces.id
|
31
|
+
LEFT JOIN plans ON plans.id = gitlab_subscriptions.hosted_plan_id
|
24
32
|
SQL
|
25
33
|
check: "SELECT 1 FROM information_schema.tables WHERE table_name='plans'"
|
26
34
|
}.freeze
|
@@ -189,6 +197,7 @@ module GitLab
|
|
189
197
|
query_string << ";"
|
190
198
|
end
|
191
199
|
end
|
200
|
+
# rubocop:enable Metrics/ClassLength
|
192
201
|
|
193
202
|
# The prober which is called when gathering metrics
|
194
203
|
class RowCountProber
|