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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61203f2c5d53c61f05151255076c5004c65a254c2445d632ae8c7262ae0e1f82
4
- data.tar.gz: 66b13da650dd0e66b3a4d639bf1738de51474e047e0df878893a5b675d158827
3
+ metadata.gz: 63b7f7660a9e551506b9e1f9ef5ae509c1af8c93da24e2a9ab32ee1363d29c7b
4
+ data.tar.gz: f410a4e7c189cbaa3ad2c169955ce2098397f86bd93061fcf6a9b85353ade364
5
5
  SHA512:
6
- metadata.gz: 7ab02d67cc6e2bf4e443e73f49138eb7549961d535a1c7425e7f9a7872ec7095f6ad77522105eee8111c674cbdebbfec304296953c884dd006832d452079414c
7
- data.tar.gz: 81bf3b39c8cb1462dabbf51be56057efb9fddfbe0db6da4d6f1f7827f71f4a8cebf04e5890caf07ccaa588b873897dfef32e91d7276361a6fe629349eb2691b0
6
+ metadata.gz: 7c93c493c8da03f94b1cd9786bebc4c83564cb60774a2786b7450faaeec6335d707c3e8f0ab1e6e2bc18466db598441cdfaccd6a4bb7482bdb232412e134cbbd
7
+ data.tar.gz: 6c406c6bffa5c8c7150e638943e895b3e9272122b5ab81a38cbdedff6a70279af72cc91a0a3de92f0459cb3621cb867927d253ca15e6e2cfc141ee909c79c120
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-exporter (6.1.0)
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.2)
23
+ pg (1.2.3)
24
24
  powerpack (0.1.1)
25
25
  quantile (0.2.1)
26
- rack (2.2.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.7)
54
+ sidekiq (5.2.8)
55
55
  connection_pool (~> 2.2, >= 2.2.2)
56
- rack (>= 1.5.0)
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 projects.namespace_id = namespaces.id
23
- LEFT JOIN plans ON namespaces.plan_id = plans.id
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
@@ -1,5 +1,5 @@
1
1
  module GitLab
2
2
  module Exporter
3
- VERSION = "6.1.0".freeze
3
+ VERSION = "7.0.0".freeze
4
4
  end
5
5
  end
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: 6.1.0
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Carranza