mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 17:33:23 +00:00
21 lines
571 B
Bash
21 lines
571 B
Bash
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
set -e
|
|
|
|
# Function to stop the guest VM
|
|
stop_guest() {
|
|
echo "Stopping guest VM..."
|
|
pgrep qemu | xargs kill
|
|
}
|
|
|
|
# Trap EXIT signal to ensure guest VM is stopped on script exit
|
|
trap stop_guest EXIT
|
|
|
|
# Run memaslap bench
|
|
echo "Running memaslap bench connected to $GUEST_SERVER_IP_ADDRESS"
|
|
# -S 1s: Dump statistic information every second
|
|
/usr/local/benchmark/libmemcached/bin/memaslap -s $GUEST_SERVER_IP_ADDRESS:11211 -t 30s -T 8 -c 32 -w 10k -S 1s
|
|
|
|
# The trap will automatically stop the guest VM when the script exits |