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, pipelines) ⇒ PeriodicPollers
constructor
A new instance of PeriodicPollers.
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(metric, queue_type, pipelines) ⇒ PeriodicPollers
Returns a new instance of PeriodicPollers.
13 14 15 16 17 18 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 13 def initialize(metric, queue_type, pipelines) @metric = metric @periodic_pollers = [PeriodicPoller::Os.new(metric), PeriodicPoller::JVM.new(metric), PeriodicPoller::PersistentQueue.new(metric, queue_type, pipelines)] end |
Instance Attribute Details
#metric ⇒ Object (readonly)
Returns the value of attribute metric.
11 12 13 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 11 def metric @metric end |
Instance Method Details
#start ⇒ Object
20 21 22 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 20 def start @periodic_pollers.map(&:start) end |
#stop ⇒ Object
24 25 26 |
# File 'lib/logstash/instrument/periodic_pollers.rb', line 24 def stop @periodic_pollers.map(&:stop) end |