def Run(benchmark_spec): """Runs the fio benchmark test. Args: benchmark_spec: specification of the benchmark. Returns: List of samples produced by the test. """ vm = benchmark_spec.vms[0] fio_exec = fio.GetFioExec(vm) remote_job_file_path = fio.GetRemoteJobFilePath(vm) total_memory_mb = vm.GetTotalMemoryMb() size_medium = min(_MAX_SIZE, total_memory_mb * _FIO_MEDIUM_SIZE) size_large = min(_MAX_SIZE, total_memory_mb * _FIO_LARGE_SIZE) filesize = FLAGS.fio_file_size or size_large seq_write_size = FLAGS.fio_sequential_write_size or size_large seq_read_size = FLAGS.fio_sequential_read_size or size_large rand_write_size = FLAGS.fio_random_write_size or size_medium rand_read_size = FLAGS.fio_random_read_size or size_medium rand_read_parallel_size = FLAGS.fio_random_read_parallel_size or size_medium job_file_contents = DEFAULT_JOB.format( filesize=filesize, runtime=FLAGS.fio_runtime, seq_write_size=seq_write_size, seq_read_size=seq_read_size, rand_write_size=rand_write_size, rand_read_size=rand_read_size, rand_read_parallel_size=rand_read_parallel_size) return linux_fio.RunWithExec(benchmark_spec, fio_exec, remote_job_file_path, job_file_contents)
def Prepare(benchmark_spec): vm = benchmark_spec.vms[0] exec_path = fio.GetFioExec(vm) linux_fio.PrepareWithExec(benchmark_spec, exec_path)