-
Notifications
You must be signed in to change notification settings - Fork 6
feat(tests): add disk performance benchmark tests #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Mathieu Labourier <[email protected]>
c89c4e6
to
385f290
Compare
@Nambrok @AnthoineB I added usage of the SR, VM, VBD, etc. fixtures. For now it's only using a local SR but I could make it use a specific SR (shared or local). I still need to add some stuff like making all parameters editable through the config file / flags. Feel free to add feedback on the current state of the PR if needed |
539c38d
to
68ecbbc
Compare
Please squash some of the |
- fix(disk_perf): add configurable numjob - fix(disk_perf): styling and readability - misc(disk_perf): simplify fixtures - misc(disk_perf): styling - fix(disk_perf): usage of double quote in nested string Signed-off-by: Mathieu Labourier <[email protected]>
- style(disk_perf): sort imports and minor style fixes Signed-off-by: Mathieu Labourier <[email protected]>
- fix(disk_perf): csv paths and add logging Signed-off-by: Mathieu Labourier <[email protected]>
Signed-off-by: Mathieu Labourier <[email protected]>
68ecbbc
to
efa4b26
Compare
Done |
jobs.py
Outdated
"params": { | ||
"--vm": "single/small_vm", | ||
}, | ||
"paths": ["tests/storage"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
path should point to benchmark subdirectory directly in the job
"paths": ["tests/storage"], | |
"paths": ["tests/storage/benchmarks"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 377d577
tests/storage/benchmarks/conftest.py
Outdated
|
||
|
||
# use vhd, qcow2, raw... when image_format support will be available | ||
@pytest.fixture(scope="module", params=["vdi"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The temporary one could have been vhd
^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 377d577
tests/storage/benchmarks/conftest.py
Outdated
("command -v apk", "apk add fio", "apk del fio"), | ||
) | ||
|
||
for check_cmd, install_cmd, remove in install_cmds: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already code allowing to install things on a VM.
You have for example lib/vm.py:VM.detect_package_manager()
that exist.
You can see example of its usage in tests/guest_tools/unix/test_guest_tools_unix.py
.
To uninstall, you can make a snapshot before installing your package and revert at the end to have the VM reset to its initial state (There might be a fixture already doing this).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in df0b40f
tests/storage/benchmarks/conftest.py
Outdated
@pytest.fixture(scope="module") | ||
def vdi_on_local_sr(host, local_sr_on_hostA1, image_format): | ||
sr = local_sr_on_hostA1 | ||
vdi = sr.create_vdi("testVDI", MAX_LENGTH) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The image_format
has to be given to create_vdi
vdi = sr.create_vdi("testVDI", MAX_LENGTH) | |
vdi = sr.create_vdi("testVDI", MAX_LENGTH, image_format=image_format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Image format is not supported yet, resulting in an error. I will provide it as a comment though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 377d577
tests/storage/benchmarks/conftest.py
Outdated
def vdi_on_local_sr(host, local_sr_on_hostA1, image_format): | ||
sr = local_sr_on_hostA1 | ||
vdi = sr.create_vdi("testVDI", MAX_LENGTH) | ||
vdi.image_format = image_format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vdi.image_format = image_format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 377d577
- change job path - set "vhd" as the placeholder image_format - remove leftover code Signed-off-by: Mathieu Labourier <[email protected]>
…rt install Signed-off-by: Mathieu Labourier <[email protected]>
tests/storage/benchmarks/conftest.py
Outdated
"--file-sizes", | ||
action="store", | ||
type=lambda value: str_to_tuple(value, sep=","), | ||
default=("1G", "4G", f"{int((system_memory // (1024.**3)) * 2)}G"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment
default=("1G", "4G", f"{int((system_memory // (1024.**3)) * 2)}G"), | |
default=("1G", "4G", f"{int((system_memory // (1024.**3)) * 2)}G"), # (2*Memory) GiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in 65157ae
vm = running_unix_vm_with_fio | ||
vbd = plugged_vbd | ||
device = f"/dev/{vbd.param_get(param_name='device')}" | ||
test_type = "{}-{}-{}-{}".format(block_size, file_size, rw_mode, image_format) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add a prefix here, like "bench-fio-", to have a common part of the name. If there is other tests we can have something like "bench-newtool-".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that adding more in the test_type could look heavy but shouldn't we add iodepth and numjob in the test_type string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add the bench- prefix indeed as well as the numjob and iodepth. I forgot to add the latter part when I added those options. I will fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 63e2cf5
logging.info("Performance difference summary:") | ||
for k, v in diffs.items(): | ||
sign = "+" if v < 0 else "-" | ||
logging.info(f"- {k}: {sign}{abs(v):.2f}%") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be interesting to have a condition that log a special message if the performance are above a threshold to signal a perf improvement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could be interesting. Both threshold (for failure and future positive message) could be changed through flags too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done in 63e2cf5
Co-authored-by: Anthoine <[email protected]> Signed-off-by: Millefeuille <[email protected]>
- add improvement threshold - adjust wording in messages - add additional information in test_type - fix percentage calculation - styling Signed-off-by: Mathieu Labourier <[email protected]>
tests/storage/benchmarks/conftest.py
Outdated
MAX_LENGTH = 64 * (1024**3) # 64GiB | ||
|
||
|
||
# use vhd, qcow2, raw... when image_format support will be available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have a TODO:
label in this case, otherwise "will" is incorrect. Otherwise we can block this PR as long as the desired code is not merged I suppose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the TODO label in 718b41f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for blocking the PR, idk since the support of image formats is not required to make it work for now. If we don't block this PR we should be cautious to not loose track of this TODO (maybe make a card about this?)
Signed-off-by: Mathieu Labourier <[email protected]>
No description provided.