diff --git a/logstash-core/lib/logstash/agent.rb b/logstash-core/lib/logstash/agent.rb index 4db2fada7..21fa2196e 100644 --- a/logstash-core/lib/logstash/agent.rb +++ b/logstash-core/lib/logstash/agent.rb @@ -113,13 +113,13 @@ class LogStash::Agent ((Time.now.to_f - STARTED_AT.to_f) * 1000.0).to_i end - def stop_collecting_metric + def stop_collecting_metrics @collector.stop @periodic_pollers.stop end def shutdown - stop_collecting_metric + stop_collecting_metrics stop_webserver shutdown_pipelines end @@ -164,7 +164,7 @@ class LogStash::Agent end def reset_metrics_collectors - stop_collecting_metric + stop_collecting_metrics configure_metrics_collectors end @@ -266,8 +266,6 @@ class LogStash::Agent def upgrade_pipeline(pipeline_id, new_pipeline) stop_pipeline(pipeline_id) @pipelines[pipeline_id] = new_pipeline - - new_pipeline = metric start_pipeline(pipeline_id) end diff --git a/logstash-core/lib/logstash/api/rack_app.rb b/logstash-core/lib/logstash/api/rack_app.rb index a7d326bb1..6c551b327 100644 --- a/logstash-core/lib/logstash/api/rack_app.rb +++ b/logstash-core/lib/logstash/api/rack_app.rb @@ -104,7 +104,7 @@ module LogStash "/_node" => LogStash::Api::Modules::Node, "/_stats" => LogStash::Api::Modules::Stats, "/_node/stats" => LogStash::Api::Modules::NodeStats, - "/_plugins" => LogStash::Api::Modules::Plugins, + "/_plugins" => LogStash::Api::Modules::Plugins } end end diff --git a/logstash-core/lib/logstash/api/service.rb b/logstash-core/lib/logstash/api/service.rb index 183451c8e..d286f8f0c 100644 --- a/logstash-core/lib/logstash/api/service.rb +++ b/logstash-core/lib/logstash/api/service.rb @@ -35,12 +35,6 @@ module LogStash end LogStash::Json.dump(data) end - - private - - def has_counters? - true - end end end end diff --git a/logstash-core/lib/logstash/pipeline.rb b/logstash-core/lib/logstash/pipeline.rb index 46c3e4318..8c6a6cf22 100644 --- a/logstash-core/lib/logstash/pipeline.rb +++ b/logstash-core/lib/logstash/pipeline.rb @@ -41,7 +41,7 @@ module LogStash; class Pipeline "LogStash::Inputs::Stdin" ] - def initialize(config_str, settings = LogStash::SETTINGS, provided_metric = nil) + def initialize(config_str, settings = LogStash::SETTINGS, namespaced_metric = nil) @config_str = config_str @logger = Cabin::Channel.get(LogStash) @settings = settings @@ -56,7 +56,7 @@ module LogStash; class Pipeline # This needs to be configured before we evaluate the code to make # sure the metric instance is correctly send to the plugins to make the namespace scoping work - @metric = provided_metric.nil? ? LogStash::Instrument::NullMetric.new : provided_metric + @metric = namespaced_metric.nil? ? LogStash::Instrument::NullMetric.new : namespaced_metric grammar = LogStashConfigParser.new @config = grammar.parse(config_str) diff --git a/logstash-core/spec/logstash/agent_spec.rb b/logstash-core/spec/logstash/agent_spec.rb index 3bc59233b..64aa3ee3c 100644 --- a/logstash-core/spec/logstash/agent_spec.rb +++ b/logstash-core/spec/logstash/agent_spec.rb @@ -381,10 +381,13 @@ describe LogStash::Agent do end after :each do - subject.shutdown - Stud.stop!(@t) - @t.join - Thread.abort_on_exception = @abort_on_exception + begin + subject.shutdown + Stud.stop!(@t) + @t.join + ensure + Thread.abort_on_exception = @abort_on_exception + end end it "resets the metric collector" do