Class: LogStash::Instrument::PeriodicPoller::PersistentQueue

Inherits:
Base
  • Object
show all
Defined in:
lib/logstash/instrument/periodic_poller/pq.rb

Constant Summary

Constants inherited from Base

Base::DEFAULT_OPTIONS

Instance Attribute Summary

Attributes inherited from Base

#metric

Instance Method Summary collapse

Methods inherited from Base

#start, #stop, #update

Methods included from Util::Loggable

included, #logger, #slow_logger

Constructor Details

#initialize(metric, queue_type, agent, options = {}) ⇒ PersistentQueue

Returns a new instance of PersistentQueue.



6
7
8
9
10
11
# File 'lib/logstash/instrument/periodic_poller/pq.rb', line 6

def initialize(metric, queue_type, agent, options = {})
  super(metric, options)
  @metric = metric
  @queue_type = queue_type
  @agent = agent
end

Instance Method Details

#collectObject



13
14
15
16
17
18
# File 'lib/logstash/instrument/periodic_poller/pq.rb', line 13

def collect
  pipeline_id, pipeline = @agent.running_pipelines.first
  unless pipeline.nil?
    pipeline.collect_stats
  end
end