Review changes

Fixes #5542
This commit is contained in:
Pier-Hugues Pellerin 2016-06-23 16:09:37 -04:00
parent 0b02cf6651
commit 64f9a27208

View file

@ -105,15 +105,13 @@ class LogStash::Plugin
end
def metric
@metric_plugin ||= begin
# We can disable metric per plugin if we want in the configuration
# we will use the NullMetric in this case.
if @enable_metric
# Fallback when testing plugin and no metric collector are correctly configured.
@metric.nil? ? LogStash::Instrument::NullMetric.new : @metric
else
LogStash::Instrument::NullMetric.new
end
# We can disable metric per plugin if we want in the configuration
# we will use the NullMetric in this case.
@metric_plugin ||= if @enable_metric
# Fallback when testing plugin and no metric collector are correctly configured.
@metric.nil? ? LogStash::Instrument::NullMetric.new : @metric
else
LogStash::Instrument::NullMetric.new
end
end
# return the configured name of this plugin