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