@gen.engine
def Benchmark(args, callback):
  assert len(args) == 1

  res = store_utils.ParseFullPath(args[0])
  assert res is not None, 'Test dir is not part of a registered bucket'
  bucket, test_dir = res

  is_read = options.options.bench_read
  num_iterations = options.options.bench_iterations

  test_data = []
  for i in options.options.bench_size_powers:
    size = 2**i
    name = os.path.join(test_dir, '%.10d' % size)
    data = os.urandom(size)
    test_data.append((size, name, data))

  store = ObjectStore.GetInstance(bucket)
  if is_read:
    logging.info('Preparing test files')
    yield [gen.Task(store.Put, filename, data) for _, filename, data in test_data]

  test_type = 'read' if is_read else 'write'
  print 'Running %s test with %d iterations per size' % (test_type, num_iterations)
  for fsize, fname, data in test_data:
    sys.stdout.write('%s %d bytes: ' % (test_type, fsize))
    start = time.time()
    total_size = 0
    tasks = []
    for i in xrange(num_iterations):
      if is_read:
        tasks.append(gen.Task(store.Get, fname))
      else:
        tasks.append(gen.Task(store.Put, fname, data))
      total_size += fsize
    if options.options.bench_parallel:
      yield tasks
    else:
      for t in tasks:
        yield t

    end = time.time()
    delta = end - start
    speed = total_size / delta / 1024
    sys.stdout.write('%.2fs, %.2fkB/s\n' % (delta, speed))

  logging.info('Cleaning up test files')
  yield [gen.Task(store.Delete, filename) for _, filename, _ in test_data]

  callback()
Estimate noise covariance matrix from epochs.
dataset/ETHPy150Open viewfinderco/viewfinder/backend/storage/tools/s3util.py/Benchmark--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/cov.py/compute_covariance