def run_benchmarks(api_client, assets, base_job, fio_bin, block_sizes, depths, modes): for i, (bs, depth, mode) in enumerate(itertools.product(block_sizes, depths, modes)): logger.info("Launching job. Block Size:%s, I/O Depth:%s, I/O Mode:%s", bs, depth, mode) job = base_job + BASE_BENCH_JOB + Job({ "bs": bs, "iodepth": depth, "rw": mode, "stonewall": None, }) configuration = api_client.configurations.get_or_create( **{ "mode": job.mode, "block_size": block_size_in_kb(job.block_size), "io_depth": job.io_depth }) engine = FIOEngine(job, fio_bin) report = engine.run_test() assert len(report) == 1, "Invalid report: {0}".format(report) job_report = SingleJobReport(job, report[0]) report_benchmark(api_client, assets, configuration, job_report)
def test_units(self): self.assertEqual(10, block_size_in_kb("10k")) self.assertEqual(10, block_size_in_kb("10kb")) self.assertEqual(10240, block_size_in_kb("10m")) self.assertEqual(10240, block_size_in_kb("10mb")) self.assertEqual(10, block_size_in_kb("10K")) self.assertEqual(10, block_size_in_kb("10KB")) self.assertEqual(10240, block_size_in_kb("10M")) self.assertEqual(10240, block_size_in_kb("10MB")) self.assertRaises(InvalidBlockSize, block_size_in_kb, "1") self.assertRaises(InvalidBlockSize, block_size_in_kb, "10ZB")
def run_benchmarks(api_client, assets, base_job, fio_bin, block_sizes, depths, modes): for i, (bs, depth, mode) in enumerate(itertools.product(block_sizes, depths, modes)): logger.info("Launching job. Block Size:%s, I/O Depth:%s, I/O Mode:%s", bs, depth, mode) job = base_job + BASE_BENCH_JOB + Job({ "bs": bs, "iodepth": depth, "rw": mode, "stonewall": None, }) configuration = api_client.configurations.get_or_create(**{ "mode": job.mode, "block_size": block_size_in_kb(job.block_size), "io_depth": job.io_depth }) engine = FIOEngine(job, fio_bin) report = engine.run_test() assert len(report) == 1, "Invalid report: {0}".format(report) job_report = SingleJobReport(job, report[0]) report_benchmark(api_client, assets, configuration, job_report)