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