# File monit/lib/symbiosis/monitor/state_db.rb, line 55
      def record(test, exitstatus, output, timestamp = Time.now)
        #
        # Insert or update based on the exit status of the last result.
        #
        last = last_result_for(test)

        if last.nil? or last['exitstatus'].to_i != exitstatus
          insert(test, exitstatus, output, timestamp.to_i)
        else
          update(test, exitstatus, output, timestamp.to_i, last['timestamp'].to_i)
        end
      end