Skip to content

Commit 5743451

Browse files
committed
feat: save vsock perf tests data
Save logs and json files for vsock perf tests. Signed-off-by: Egor Lazarchuk <yegorlz@amazon.co.uk>
1 parent 401831b commit 5743451

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/integration_tests/performance/test_vsock_ab.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# SPDX-License-Identifier: Apache-2.0
33
"""Tests the VSOCK throughput of Firecracker uVMs."""
44

5+
import json
56
import os
7+
from pathlib import Path
68

79
import pytest
810

@@ -73,7 +75,14 @@ def guest_command(self, port_offset):
7375
@pytest.mark.parametrize("payload_length", ["64K", "1024K"], ids=["p64K", "p1024K"])
7476
@pytest.mark.parametrize("mode", ["g2h", "h2g", "bd"])
7577
def test_vsock_throughput(
76-
microvm_factory, guest_kernel_acpi, rootfs, vcpus, payload_length, mode, metrics
78+
microvm_factory,
79+
guest_kernel_acpi,
80+
rootfs,
81+
vcpus,
82+
payload_length,
83+
mode,
84+
metrics,
85+
results_dir,
7786
):
7887
"""
7988
Test vsock throughput for multiple vm configurations.
@@ -107,4 +116,13 @@ def test_vsock_throughput(
107116
test = VsockIPerf3Test(vm, mode, payload_length)
108117
data = test.run_test(vm.vcpus_count + 2)
109118

119+
for i, g2h in enumerate(data["g2h"]):
120+
Path(results_dir / f"g2h_{i}.json").write_text(
121+
json.dumps(g2h), encoding="utf-8"
122+
)
123+
for i, h2g in enumerate(data["h2g"]):
124+
Path(results_dir / f"h2g_{i}.json").write_text(
125+
json.dumps(h2g), encoding="utf-8"
126+
)
127+
110128
emit_iperf3_metrics(metrics, data, VsockIPerf3Test.WARMUP_SEC)

0 commit comments

Comments
 (0)