mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -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
|
class Metric
|
||||||
attr_reader :collector
|
attr_reader :collector
|
||||||
|
|
||||||
def initialize(collector = LogStash::Instrument::Collector.instance)
|
def initialize(collector)
|
||||||
@collector = collector
|
@collector = collector
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ require "logstash/instrument/collector"
|
||||||
require "spec_helper"
|
require "spec_helper"
|
||||||
|
|
||||||
describe LogStash::Instrument::Collector do
|
describe LogStash::Instrument::Collector do
|
||||||
subject { LogStash::Instrument::Collector.instance }
|
subject { LogStash::Instrument::Collector.new }
|
||||||
describe "#push" do
|
describe "#push" do
|
||||||
let(:namespaces_path) { [:root, :pipelines, :pipelines01] }
|
let(:namespaces_path) { [:root, :pipelines, :pipelines01] }
|
||||||
let(:key) { :my_key }
|
let(:key) { :my_key }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue