Class: LogStash::Instrument::PeriodicPollers
- Inherits:
-
Object
- Object
- LogStash::Instrument::PeriodicPollers
- Defined in:
- lib/logstash/instrument/periodic_pollers.rb
Overview
Each PeriodPoller manager his own thread to do the poller of the stats, this class encapsulate the starting and stopping of the poller if the unique timer uses too much resource we can refactor this behavior here.
Instance Attribute Summary collapse
-
#metric ⇒ Object
readonly
Returns the value of attribute metric.
Instance Method Summary collapse
-
#initialize(metric, queue_type, agent) ⇒ PeriodicPollers
constructor
A new instance of PeriodicPollers.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(metric, queue_type, agent) ⇒ PeriodicPollers
Returns a new instance of PeriodicPollers.
14 15 16 17 18 19 20 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 14 def initialize(metric, queue_type, agent) @metric = metric @periodic_pollers = [PeriodicPoller::Os.new(metric), PeriodicPoller::JVM.new(metric), PeriodicPoller::PersistentQueue.new(metric, queue_type, agent), PeriodicPoller::DeadLetterQueue.new(metric, agent)] end |
Instance Attribute Details
#metric ⇒ Object (readonly)
Returns the value of attribute metric.
12 13 14 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 12 def metric @metric end |
Instance Method Details
#start ⇒ Object
22 23 24 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 22 def start @periodic_pollers.map(&:start) end |
#stop ⇒ Object
26 27 28 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 26 def stop @periodic_pollers.map(&:stop) end |