Example #1
0
def test_arizonatransfer( file, filehash, filesize, remote_host, tmpfs_dir ):
   ts = 0
   te = 0
   file_url = remote_host + file
   
   file_data = {
      "filename": file[1:],
      "hash": filehash,
      "size": int(filesize),
      "hashfuncs": [arizonatransfer.default_hashfunc]
   }
  
   for i in xrange(0, 10):
      # transfer the file with arizonatransfer 5 times, excluding getting the metafile
      
      
      ts = time.time()
      rc, downloaded_files = arizonatransfer.getfiles1(remote_host, [file_data], tmpfs_dir, None, True, prioritylist = ["http"])
      te = time.time()
      if not rc:
         print "arizonatransfer failed!"
         print "downloaded files: " + str(downloaded_files)

      
      iftlog.log(5, "arizonatransfer " + file_url + " " + str(te - ts) )
Example #2
0
def test_arizonatransfer( file, filehash, filesize, remote_host, tmpfs_dir ):
   ts = 0
   te = 0
   file_url = remote_host + file
   
   file_data = {
      "filename": file[1:],
      "hash": filehash,
      "size": int(filesize),
      "hashfuncs": [arizonatransfer.default_hashfunc]
   }
  
   for i in xrange(0, 1):
      
      #arizonaconfig.init_options("experiment2_client.py", configfile_optvar="configfile")
      
      ts = time.time()
      rc, downloaded_files = arizonatransfer.getfiles1(remote_host, [file_data], tmpfs_dir, None, True, prioritylist = ["http2", "http"])
      te = time.time()
      if not rc:
         print "arizonatransfer failed!"
         print "downloaded files: " + str(downloaded_files)

      iftlog.log(5, "arizonatransfer " + file_url + " " + str(te - ts) )