gitlab-exporter 7.1.1 → 7.1.2

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: 9ef9540e75d17cc9904aa53962399870425e6ca52d57ed994dff10d53fad201f
4
- data.tar.gz: 7ab18ebbb09faaac5c4924cab93af2059dbe28e4177365771c897a153878daee
3
+ metadata.gz: 350884c8d1f03a58cad2630e0076aa641d22d60aed65a5d2342cb7f4508ec655
4
+ data.tar.gz: d1857b8e6a8f842b438d12810c110ff4b8bbdf5226b5a6c5859dd949c12d1dd6
5
5
  SHA512:
6
- metadata.gz: 05a779426c541c1371d880b9b2d4a321b78243b4bb89ce8c8a4d41e977569f88386505e205719079b0ea85a1bbc3f9d5558bdbb6e1de94de4eb283c05513ad16
7
- data.tar.gz: 39fa8909ce99c35bc0e929760cf820593b3ee30526fdb4d10f3230646f63f271b4b3b8e29cc62fbde59106d5f4563335c184f18de21fe8fe5246f7b722ed0b0e
6
+ metadata.gz: 9b62aaf4f95b4da82b1e5bc86058b97c363a1b43ae7026589e30da6af47ccf69261ec279094574927180b270be358afbba8304d10bff3fe8fb047fb54b6be538
7
+ data.tar.gz: 34d27b77c5b04c4a079d184ff30db9b75f37471f9ac0e5199790ce550ee360e52d6f81d2b22b6f159a780ff7525b866b79f8ab0c06265d6251f697177b86fc83
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gitlab-exporter (7.1.1)
4
+ gitlab-exporter (7.1.2)
5
5
  connection_pool (~> 2.2.1)
6
6
  pg (~> 1.1)
7
7
  quantile (~> 0.2.0)
@@ -3,6 +3,8 @@ module GitLab
3
3
  module Database
4
4
  # Helper to collect bloat metrics.
5
5
  class BloatCollector < Base
6
+ attr_writer :logger
7
+
6
8
  def run(type = :btree)
7
9
  execute(self.class.query_for(type)).each_with_object({}) do |row, h|
8
10
  h[row["object_name"]] = row
@@ -39,9 +41,11 @@ module GitLab
39
41
 
40
42
  def initialize(opts,
41
43
  metrics: PrometheusMetrics.new,
42
- collector: BloatCollector.new(connection_string: opts[:connection_string]))
44
+ collector: BloatCollector.new(connection_string: opts[:connection_string]),
45
+ logger: nil)
43
46
  @metrics = metrics
44
47
  @collector = collector
48
+ @collector.logger = logger
45
49
  @bloat_types = opts[:bloat_types] || %i(btree table)
46
50
  end
47
51
 
@@ -1,5 +1,5 @@
1
1
  module GitLab
2
2
  module Exporter
3
- VERSION = "7.1.1".freeze
3
+ VERSION = "7.1.2".freeze
4
4
  end
5
5
  end
@@ -43,7 +43,11 @@ describe GitLab::Exporter::Database::BloatProber do
43
43
  end
44
44
 
45
45
  describe "#probe_db" do
46
- subject { described_class.new(opts, metrics: metrics, collector: collector).probe_db }
46
+ subject { described_class.new(opts, metrics: metrics, collector: collector, logger: STDOUT).probe_db }
47
+
48
+ before do
49
+ expect(collector).to receive(:logger=).with(STDOUT)
50
+ end
47
51
 
48
52
  it "invokes the collector for each bloat type" do
49
53
  expect(collector).to receive(:run).with(:btree)
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: 7.1.1
4
+ version: 7.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pablo Carranza