lib/splash/orchestrator.rb in prometheus-splash-0.1.0 vs lib/splash/orchestrator.rb in prometheus-splash-0.1.1

- old
+ new

@@ -1,8 +1,6 @@ -require 'socket' -require 'yaml' - +# coding: utf-8 module Splash module Orchestrator module SchedulerHooks def on_pre_trigger(job, trigger_time) @@ -33,22 +31,23 @@ def ping(payload) return "Pong : #{payload[:hostname]} !" end end - class Scheduler include Splash::Constants include Splash::Helpers include Splash::Config include Splash::Transports include Splash::Orchestrator::Grammar def initialize @server = Rufus::Scheduler::new @server.extend SchedulerHooks @server.init_log + @config = get_config @result = LogScanner::new - @server.every '20s' do + sched,value = @config.daemon_logmon_scheduling.flatten + @server.send sched,value do begin puts "Notify" @result.analyse @result.notify $stdout.flush