mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
6acbdc3015
commit
a741534f7c
5 changed files with 13 additions and 18 deletions
|
@ -113,13 +113,13 @@ class LogStash::Agent
|
||||||
((Time.now.to_f - STARTED_AT.to_f) * 1000.0).to_i
|
((Time.now.to_f - STARTED_AT.to_f) * 1000.0).to_i
|
||||||
end
|
end
|
||||||
|
|
||||||
def stop_collecting_metric
|
def stop_collecting_metrics
|
||||||
@collector.stop
|
@collector.stop
|
||||||
@periodic_pollers.stop
|
@periodic_pollers.stop
|
||||||
end
|
end
|
||||||
|
|
||||||
def shutdown
|
def shutdown
|
||||||
stop_collecting_metric
|
stop_collecting_metrics
|
||||||
stop_webserver
|
stop_webserver
|
||||||
shutdown_pipelines
|
shutdown_pipelines
|
||||||
end
|
end
|
||||||
|
@ -164,7 +164,7 @@ class LogStash::Agent
|
||||||
end
|
end
|
||||||
|
|
||||||
def reset_metrics_collectors
|
def reset_metrics_collectors
|
||||||
stop_collecting_metric
|
stop_collecting_metrics
|
||||||
configure_metrics_collectors
|
configure_metrics_collectors
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -266,8 +266,6 @@ class LogStash::Agent
|
||||||
def upgrade_pipeline(pipeline_id, new_pipeline)
|
def upgrade_pipeline(pipeline_id, new_pipeline)
|
||||||
stop_pipeline(pipeline_id)
|
stop_pipeline(pipeline_id)
|
||||||
@pipelines[pipeline_id] = new_pipeline
|
@pipelines[pipeline_id] = new_pipeline
|
||||||
|
|
||||||
new_pipeline = metric
|
|
||||||
start_pipeline(pipeline_id)
|
start_pipeline(pipeline_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ module LogStash
|
||||||
"/_node" => LogStash::Api::Modules::Node,
|
"/_node" => LogStash::Api::Modules::Node,
|
||||||
"/_stats" => LogStash::Api::Modules::Stats,
|
"/_stats" => LogStash::Api::Modules::Stats,
|
||||||
"/_node/stats" => LogStash::Api::Modules::NodeStats,
|
"/_node/stats" => LogStash::Api::Modules::NodeStats,
|
||||||
"/_plugins" => LogStash::Api::Modules::Plugins,
|
"/_plugins" => LogStash::Api::Modules::Plugins
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -35,12 +35,6 @@ module LogStash
|
||||||
end
|
end
|
||||||
LogStash::Json.dump(data)
|
LogStash::Json.dump(data)
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def has_counters?
|
|
||||||
true
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -41,7 +41,7 @@ module LogStash; class Pipeline
|
||||||
"LogStash::Inputs::Stdin"
|
"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
|
@config_str = config_str
|
||||||
@logger = Cabin::Channel.get(LogStash)
|
@logger = Cabin::Channel.get(LogStash)
|
||||||
@settings = settings
|
@settings = settings
|
||||||
|
@ -56,7 +56,7 @@ module LogStash; class Pipeline
|
||||||
|
|
||||||
# This needs to be configured before we evaluate the code to make
|
# 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
|
# 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
|
grammar = LogStashConfigParser.new
|
||||||
@config = grammar.parse(config_str)
|
@config = grammar.parse(config_str)
|
||||||
|
|
|
@ -381,10 +381,13 @@ describe LogStash::Agent do
|
||||||
end
|
end
|
||||||
|
|
||||||
after :each do
|
after :each do
|
||||||
subject.shutdown
|
begin
|
||||||
Stud.stop!(@t)
|
subject.shutdown
|
||||||
@t.join
|
Stud.stop!(@t)
|
||||||
Thread.abort_on_exception = @abort_on_exception
|
@t.join
|
||||||
|
ensure
|
||||||
|
Thread.abort_on_exception = @abort_on_exception
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
it "resets the metric collector" do
|
it "resets the metric collector" do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue