Refactor the metric library interaction

The metric library now require an instance of the collector and will not
use the singleton

Fixes #5446
This commit is contained in:
Pier-Hugues Pellerin 2016-06-02 10:42:06 -04:00
parent 0b50e2e624
commit d02d4e4429
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ module LogStash module Instrument
class Metric
attr_reader :collector
def initialize(collector = LogStash::Instrument::Collector.instance)
def initialize(collector)
@collector = collector
end

View file

@ -3,7 +3,7 @@ require "logstash/instrument/collector"
require "spec_helper"
describe LogStash::Instrument::Collector do
subject { LogStash::Instrument::Collector.instance }
subject { LogStash::Instrument::Collector.new }
describe "#push" do
let(:namespaces_path) { [:root, :pipelines, :pipelines01] }
let(:key) { :my_key }