Class: Cloudscale::Monitor::Schedule
- Inherits:
-
Object
- Object
- Cloudscale::Monitor::Schedule
- Defined in:
- lib/cloudscale/schedule.rb
Instance Method Summary collapse
-
#initialize(plugins, agentInstanceId) ⇒ Schedule
constructor
A new instance of Schedule.
Constructor Details
#initialize(plugins, agentInstanceId) ⇒ Schedule
Returns a new instance of Schedule.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/cloudscale/schedule.rb', line 14 def initialize(plugins, agentInstanceId) scheduler = Rufus::Scheduler.new registry = Monitor::Registry.instance scheduler.every '5s', :first => :now do plugins.each do | plugin | if plugin.respond_to?('collect') && plugin.is_enabled plugin.collect(agentInstanceId) end end Monitor::InfluxDbReporter.instance.report(registry.metrics) end scheduler.join end |