mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
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:
parent
0b50e2e624
commit
d02d4e4429
2 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue