Commit 40bc81a4 authored by Ahmad Sherif's avatar Ahmad Sherif

Unify parameter passing to prober classes

parent 024b6f42
......@@ -48,7 +48,7 @@ module GitLab
def run
validate!
::GitLab::Monitor::GitProber.new(self)
::GitLab::Monitor::GitProber.new(labels: labels, source: source)
.probe_pull
.probe_push
.write_to(@target)
......
......@@ -20,7 +20,7 @@ module GitLab
# Probes the DB specified by opts[:connection_string] for dead tubles stats, then converts them to metrics
class DeadTuplesProber
def initialize(opts, metrics = PrometheusMetrics.new)
def initialize(opts, metrics: PrometheusMetrics.new)
@metrics = metrics
@collector = DeadTuplesCollector.new(connection_string: opts[:connection_string])
end
......
......@@ -62,10 +62,10 @@ module GitLab
# Optionally takes a metrics object which by default is a PrometheusMetrics, useful to change the
# metrics writer to something else.
class GitProber
def initialize(options, metrics: PrometheusMetrics.new)
def initialize(opts, metrics: PrometheusMetrics.new)
@metrics = metrics
@labels = options.labels || {}
@git = Git.new(options.source)
@labels = opts[:labels] || {}
@git = Git.new(opts[:source])
end
def probe_pull
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment