mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-25 10:23:23 +00:00
Add tcp latency test over virtio-net
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
e78303b01a
commit
090149eed7
9
test/benchmark/lmbench/tcp_virtio_lat/config.json
Normal file
9
test/benchmark/lmbench/tcp_virtio_lat/config.json
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"alert_threshold": "125%",
|
||||
"alert_tool": "customSmallerIsBetter",
|
||||
"search_pattern": "TCP latency using 127.0.0.1:",
|
||||
"result_index": "5",
|
||||
"description": "lat_tcp_virtio",
|
||||
"title": "[TCP sockets] The latency over virtio-net",
|
||||
"benchmark_type": "host_guest"
|
||||
}
|
21
test/benchmark/lmbench/tcp_virtio_lat/host.sh
Normal file
21
test/benchmark/lmbench/tcp_virtio_lat/host.sh
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
set -e
|
||||
|
||||
# Function to stop the guest VM
|
||||
stop_guest() {
|
||||
echo "Stopping guest VM..."
|
||||
# `-r` means if there's no qemu, the kill won't be executed
|
||||
pgrep qemu | xargs -r kill
|
||||
}
|
||||
|
||||
# Trap EXIT signal to ensure guest VM is stopped on script exit
|
||||
trap stop_guest EXIT
|
||||
|
||||
# Run lmbench tcp client
|
||||
echo "Running lmbench tcp client"
|
||||
/usr/local/benchmark/lmbench/lat_tcp -P 1 127.0.0.1
|
||||
|
||||
# The trap will automatically stop the guest VM when the script exits
|
14
test/benchmark/lmbench/tcp_virtio_lat/result_template.json
Normal file
14
test/benchmark/lmbench/tcp_virtio_lat/result_template.json
Normal file
@ -0,0 +1,14 @@
|
||||
[
|
||||
{
|
||||
"name": "Average TCP latency over virtio-net on Linux",
|
||||
"unit": "µs",
|
||||
"value": 0,
|
||||
"extra": "linux_result"
|
||||
},
|
||||
{
|
||||
"name": "Average TCP latency over virtio-net on Asterinas",
|
||||
"unit": "µs",
|
||||
"value": 0,
|
||||
"extra": "aster_result"
|
||||
}
|
||||
]
|
13
test/benchmark/lmbench/tcp_virtio_lat/run.sh
Normal file
13
test/benchmark/lmbench/tcp_virtio_lat/run.sh
Normal file
@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
# SPDX-License-Identifier: MPL-2.0
|
||||
|
||||
set -e
|
||||
|
||||
echo "Running lmbench TCP latency over virtio-net..."
|
||||
|
||||
# Start the server
|
||||
/benchmark/bin/lmbench/lat_tcp -s 10.0.2.15
|
||||
|
||||
# Sleep for a long time to ensure VM won't exit
|
||||
sleep 200
|
Reference in New Issue
Block a user