mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 14:47:19 -04:00
parent
fdf19eab2e
commit
d2400ac93a
1 changed files with 5 additions and 0 deletions
|
@ -28,6 +28,7 @@ module LogStash class OutputDelegator
|
||||||
# Scope the metrics to the plugin
|
# Scope the metrics to the plugin
|
||||||
namespaced_metric = metric.namespace(output.plugin_unique_name.to_sym)
|
namespaced_metric = metric.namespace(output.plugin_unique_name.to_sym)
|
||||||
@metric_events = namespaced_metric.namespace(:events)
|
@metric_events = namespaced_metric.namespace(:events)
|
||||||
|
namespaced_metric.gauge(:name, config_name)
|
||||||
|
|
||||||
@events_received = Concurrent::AtomicFixnum.new(0)
|
@events_received = Concurrent::AtomicFixnum.new(0)
|
||||||
end
|
end
|
||||||
|
@ -129,7 +130,9 @@ module LogStash class OutputDelegator
|
||||||
@events_received.increment(events.length)
|
@events_received.increment(events.length)
|
||||||
@metric_events.increment(:in, events.length)
|
@metric_events.increment(:in, events.length)
|
||||||
|
|
||||||
|
clock = @metric_events.time(:duration_in_millis)
|
||||||
@threadsafe_worker.multi_receive(events)
|
@threadsafe_worker.multi_receive(events)
|
||||||
|
clock.stop
|
||||||
@metric_events.increment(:out, events.length)
|
@metric_events.increment(:out, events.length)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -139,7 +142,9 @@ module LogStash class OutputDelegator
|
||||||
|
|
||||||
worker = @worker_queue.pop
|
worker = @worker_queue.pop
|
||||||
begin
|
begin
|
||||||
|
clock = @metric_events.time(:duration_in_millis)
|
||||||
worker.multi_receive(events)
|
worker.multi_receive(events)
|
||||||
|
clock.stop
|
||||||
@metric_events.increment(:out, events.length)
|
@metric_events.increment(:out, events.length)
|
||||||
ensure
|
ensure
|
||||||
@worker_queue.push(worker)
|
@worker_queue.push(worker)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue