def start
      if !host_agent_available?
        if !ENV.key?("INSTANA_QUIET")
          ::Instana.logger.warn "Host agent not available.  Will retry periodically. (Set env INSTANA_QUIET=1 to shut these messages off)"
        end
      end

      loop do
        if @state == :unannounced
          @collect_timer.pause
          @announce_timer.resume
        else
          @announce_timer.pause
          @collect_timer.resume
        end
        @timers.wait
      end
    rescue Exception => e
      ::Instana.logger.warn "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
      ::Instana.logger.debug e.backtrace.join("\r\n")
    ensure
      if @state == :announced
        # Pause the timers so they don't fire while we are
        # reporting traces
        @collect_timer.pause
        @announce_timer.pause

        ::Instana.logger.debug "#{Thread.current}: Agent exiting. Reporting final #{::Instana.processor.queue_count} trace(s)."
        ::Instana.processor.send
      end
    end
def start
      if !host_agent_available?
        if !ENV.key?("INSTANA_QUIET")
          ::Instana.logger.warn "Host agent not available.  Will retry periodically. (Set env INSTANA_QUIET=1 to shut these messages off)"
        end
      end

      loop do
        if @state == :unannounced
          @collect_timer.pause
          @announce_timer.resume
        else
          @announce_timer.pause
          @collect_timer.resume
        end
        @timers.wait
      end
    rescue Exception => e
      ::Instana.logger.warn "#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}"
      ::Instana.logger.debug e.backtrace.join("\r\n")
    ensure
      if @state == :announced
        # Pause the timers so they don't fire while we are
        # reporting traces
        @collect_timer.pause
        @announce_timer.pause

        ::Instana.logger.debug "#{Thread.current}: Agent exiting. Reporting final #{::Instana.processor.queue_count} trace(s)."
        ::Instana.processor.send
      end
    end
Starts the timer loop for the timers that were initialized
 in the setup method.  This is blocking and should only be
 called from an already initialized background thread.