From d2400ac93a63a438891c4e2156c1c13b243a0a83 Mon Sep 17 00:00:00 2001 From: Jordan Sissel Date: Tue, 14 Jun 2016 09:48:53 -0700 Subject: [PATCH] Add plugin name and wallclock duration to output metrics. Fixes #5472 --- logstash-core/lib/logstash/output_delegator.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/logstash-core/lib/logstash/output_delegator.rb b/logstash-core/lib/logstash/output_delegator.rb index a8d05c18e..d6450ac43 100644 --- a/logstash-core/lib/logstash/output_delegator.rb +++ b/logstash-core/lib/logstash/output_delegator.rb @@ -28,6 +28,7 @@ module LogStash class OutputDelegator # Scope the metrics to the plugin namespaced_metric = metric.namespace(output.plugin_unique_name.to_sym) @metric_events = namespaced_metric.namespace(:events) + namespaced_metric.gauge(:name, config_name) @events_received = Concurrent::AtomicFixnum.new(0) end @@ -129,7 +130,9 @@ module LogStash class OutputDelegator @events_received.increment(events.length) @metric_events.increment(:in, events.length) + clock = @metric_events.time(:duration_in_millis) @threadsafe_worker.multi_receive(events) + clock.stop @metric_events.increment(:out, events.length) end @@ -139,7 +142,9 @@ module LogStash class OutputDelegator worker = @worker_queue.pop begin + clock = @metric_events.time(:duration_in_millis) worker.multi_receive(events) + clock.stop @metric_events.increment(:out, events.length) ensure @worker_queue.push(worker)