def METHOD_NAME(directory, iops, request_size, rw, name):
    # Through experimentation, 1000 was the fewest number of IOs with a consistent average
    number_ios = 1000
    # Rate limit the fio command to non-burst IOPs to avoid inaccurate latency measurement due to throttling
    fio_command = [
        '/usr/bin/fio', '--direct=1', '--ioengine=libaio', '--iodepth=1',
        '--time_based=0', f'--name={name}', f'--size=10MB',
        '--output-format=json', '--overwrite=1', f'--rw={rw}',
        f'--bs={request_size}k', f'--number_ios={number_ios}',
        f'--rate_iops={iops}', f'--directory={directory}'
    ]
    # For usability, print an approximate expected runtime
    expected_runtime = 2
    logger.info('Running: %s.\nThis will take approximately %d seconds.' % (' '.join(shlex.quote(i) for i in fio_command), expected_runtime))
    return json.loads(subprocess.check_output(fio_command))