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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/gitlab_exporter/database/bloat.rb +5 -1
- data/lib/gitlab_exporter/version.rb +1 -1
- data/spec/database/bloat_spec.rb +5 -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: 350884c8d1f03a58cad2630e0076aa641d22d60aed65a5d2342cb7f4508ec655
|
4
|
+
data.tar.gz: d1857b8e6a8f842b438d12810c110ff4b8bbdf5226b5a6c5859dd949c12d1dd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b62aaf4f95b4da82b1e5bc86058b97c363a1b43ae7026589e30da6af47ccf69261ec279094574927180b270be358afbba8304d10bff3fe8fb047fb54b6be538
|
7
|
+
data.tar.gz: 34d27b77c5b04c4a079d184ff30db9b75f37471f9ac0e5199790ce550ee360e52d6f81d2b22b6f159a780ff7525b866b79f8ab0c06265d6251f697177b86fc83
|
data/Gemfile.lock
CHANGED
@@ -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
|
|
data/spec/database/bloat_spec.rb
CHANGED
@@ -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)
|