Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions bench_fio/benchlib/argparsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ def get_arguments(settings):
nargs="+",
type=str,
)
ag.add_argument(
"--template",
help="Benchmark template to use",
default="benchmark.ini",
)
ag.add_argument(
"-t",
"--type",
Expand Down Expand Up @@ -92,7 +97,7 @@ def get_arguments(settings):

ag.add_argument(
"--runtime",
help=f"Override the default test runtime per benchmark"
help=f"Override the default test runtime per benchmark (seconds)"
f"(default: {settings['runtime']})",
type=int,
default=settings["runtime"],
Expand Down Expand Up @@ -230,7 +235,7 @@ def get_arguments(settings):
default=settings["invalidate"],
)
ag.add_argument(
"--quiet", help="The progresbar will be supressed.", action="store_true"
"--quiet", help="The progress bar will be supressed.", action="store_true"
)
ag.add_argument(
"--loginterval",
Expand Down
1 change: 1 addition & 0 deletions bench_fio/benchlib/defaultsettings.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def get_default_settings():
settings = {}
settings["benchmarks"] = None
settings["target"] = []
settings["template"] = "benchmark.ini"
settings["type"] = None
settings["engine"] = "libaio"
settings["mode"] = ["randread"]
Expand Down
7 changes: 3 additions & 4 deletions bench_fio/benchlib/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def calculate_duration(settings, tests):
number_of_tests = number_of_tests/len(settings["target"])
time_per_test = settings["runtime"]
if time_per_test:
duration_in_seconds = number_of_tests * time_per_test
duration_in_seconds = int(number_of_tests * time_per_test)
duration = str(datetime.timedelta(seconds=duration_in_seconds))
else:
duration = None
Expand All @@ -56,7 +56,7 @@ def print_options(settings, table):
data = parse_settings_for_display(settings)
for item in settings.keys():
if item not in settings["filter_items"]: # filter items are internal options that aren't relevant
if item not in descriptions.keys():
if item not in descriptions.keys():
customitem = item + "*" # These are custom fio options so we mark them as such
#print(f"{customitem:<{fl}}: {data[item]:<}")
table.add_row(customitem, data[item])
Expand All @@ -70,7 +70,6 @@ def print_options(settings, table):


def display_header(settings, tests):

duration = calculate_duration(settings, tests)
table = Table(title="Bench-fio",title_style=Style(bgcolor="dodger_blue2",bold=True))
table.add_column(no_wrap=True, header="Setting")
Expand All @@ -79,4 +78,4 @@ def display_header(settings, tests):
table.add_row("Estimated Duration",duration)
print_options(settings, table)
console = Console()
console.print(table)
console.print(table)
2 changes: 1 addition & 1 deletion bench_fio/benchlib/generatefio.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def filter_options(settings, config, mapping, benchmark, output_directory):
if isinstance(value, bool):
value = boolean[str(value)]
if key == "type": # we check if we target a file directory or block device
devicetype = checks.check_target_type(benchmark["target_base"], settings)
devicetype = checks.check_target_type(benchmark["target"], settings)
config["FIOJOB"][devicetype] = benchmark["target"]
if (
value
Expand Down
4 changes: 2 additions & 2 deletions bench_fio/benchlib/runfio.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def run_fio(settings, benchmark):
# passed to fio's filename but should be removed when checking the
# existance of the path, or when writing a job file or log file in
# the filesystem.
benchmark.update({"target_base": benchmark['target'].replace("\\", "")})
tmpjobfile = f"/tmp/{os.path.basename(benchmark['target_base'])}-tmpjobfile.fio"
benchmark.update({"target": benchmark['target'].replace("\\", "")})
tmpjobfile = f"/tmp/{os.path.basename(benchmark['target'])}-tmpjobfile.fio"
output_directory = supporting.generate_output_directory(settings, benchmark)
output_file = f"{output_directory}/{benchmark['mode']}-{benchmark['iodepth']}-{benchmark['numjobs']}.json"
generatefio.generate_fio_job_file(settings, benchmark, output_directory, tmpjobfile)
Expand Down
4 changes: 2 additions & 2 deletions bench_fio/benchlib/supporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def generate_output_directory(settings, benchmark):
settings["output"] = os.path.expanduser(settings["output"])
if benchmark["mode"] in settings["mixed"]:
directory = (
f"{settings['output']}/{os.path.basename(benchmark['target_base'])}/"
f"{settings['output']}/{os.path.basename(benchmark['target'])}/"
f"{benchmark['mode']}{benchmark['rwmixread']}/{benchmark['block_size']}"
)
else:
directory = f"{settings['output']}/{os.path.basename(benchmark['target_base'])}/{benchmark['block_size']}"
directory = f"{settings['output']}/{os.path.basename(benchmark['target'])}/{benchmark['block_size']}"

if "run" in benchmark.keys():
directory = directory + f"/run-{benchmark['run']}"
Expand Down
6 changes: 0 additions & 6 deletions bin/bench-fio

This file was deleted.

6 changes: 0 additions & 6 deletions bin/fio-plot

This file was deleted.

22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[project]
version = "1.1.16"
name = "fio-plot"

dependencies = [
"numpy",
"matplotlib",
"pillow",
"pyan3",
"rich",
]

[project.gui-scripts]
fio-plot = "fio_plot:main"
bench_fio = "bench_fio:main"

[tool.setuptools.packages.find]
exclude = ["bench_fio.scripts"]
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
numpy
Pillow
pyparsing
matplotlib<=3.8
pyan3
rich
22 changes: 0 additions & 22 deletions setup.py

This file was deleted.

6 changes: 3 additions & 3 deletions tests/bench_fio_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ def setUp(self):
self.settings["output"] = "output_directory"

def test_generate_benchmarks(self):
self.assertEqual(len(supporting.generate_test_list(self.settings)), 98)
self.assertEqual(len(supporting.generate_test_list(self.settings)), 49)

def test_generate_benchmarks_big(self):
self.settings["target"] = ["filea", "fileb", "filec", "filed"]
self.settings["block_size"] = ["4k", "8k", "16k", "32k"]
self.assertEqual(len(supporting.generate_test_list(self.settings)), 1568)
self.assertEqual(len(supporting.generate_test_list(self.settings)), 784)

def test_are_loop_items_lists(self):
for item in self.settings["loop_items"]:
Expand All @@ -32,7 +32,7 @@ def test_are_loop_items_lists(self):

def test_calculate_duration(self):
self.assertEqual(
display.calculate_duration(self.settings, self.tests), "1:38:00"
display.calculate_duration(self.settings, self.tests), "0:49:00"
)

def test_generate_output_directory_regular(self):
Expand Down
8 changes: 6 additions & 2 deletions tests/test_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,21 @@ def test_correct_bars_drawn(self):
"rw": "read",
"source": "test",
"title": "test",
"title_fontsize": 12,
"subtitle_fontsize": 20,
"subtitle": "",
"filter": ["read", "write"],
# intentionally using prime numbers
"iodepth": [2, 3],
"numjobs": [5, 11],
"maxjobs": 32,
"maxdepth": 32,
"max": None,
"max_z": None,
"dpi": 200,
"disable_fio_version": 2.0,
"output_filename": "/tmp/test.png"
"output_filename": "/tmp/test.png",
"truncate_xaxis": False,
"source_fontsize": 12,
}

dataset = [{"data": []}]
Expand Down