def run
      start_time = Time.new.to_f
      Signal.trap('TERM') do
        log.info('SIGTERM received. shutting down gracefully...')
        @request_shutdown = true
      end
      run_desc = @dry_run ? 'dry run' : 'run'
      log.info("beginning alerts #{run_desc}")

      alerts = read_alerts(@alert_sources)
      groups = read_groups(@group_sources)
      hosts = read_hosts(@host_sources)

      @destinations.each do |dest|
        dest['options'] ||= {}
        dest['options']['dry_run'] = true if @dry_run
      end

      update_alerts(@destinations, hosts, alerts, groups)

      run_time = Time.new.to_f - start_time
      if @request_shutdown
        log.info("interferon #{run_desc} shut down by SIGTERM")
      else
        statsd.gauge('run_time', run_time)
        log.info("interferon #{run_desc} complete in %.2f seconds" % run_time)
      end
    end
def run
      start_time = Time.new.to_f
      Signal.trap('TERM') do
        log.info('SIGTERM received. shutting down gracefully...')
        @request_shutdown = true
      end
      run_desc = @dry_run ? 'dry run' : 'run'
      log.info("beginning alerts #{run_desc}")

      alerts = read_alerts(@alert_sources)
      groups = read_groups(@group_sources)
      hosts = read_hosts(@host_sources)

      @destinations.each do |dest|
        dest['options'] ||= {}
        dest['options']['dry_run'] = true if @dry_run
      end

      update_alerts(@destinations, hosts, alerts, groups)

      run_time = Time.new.to_f - start_time
      if @request_shutdown
        log.info("interferon #{run_desc} shut down by SIGTERM")
      else
        statsd.gauge('run_time', run_time)
        log.info("interferon #{run_desc} complete in %.2f seconds" % run_time)
      end
    end
groups_sources is a hash from type => options for each group source
 host_sources is a hash from type => options for each host source
 destinations is a similar hash from type => options for each alerter