-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_kv_workload.sh
executable file
·51 lines (40 loc) · 1.57 KB
/
run_kv_workload.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e
set -o pipefail
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)"
source $DIR/common.sh
setup
########################
# Parse input argument
########################
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <arg1>"
echo "Error: Please provide the benchmark type as argument, options are [board|miralis|protect]"
exit 1
fi
# We only allow three kind of benchmark types
if ! [[ "$1" == "board" || "$1" == "miralis" || "$1" == "protect" ]]; then
echo "Error: Invalid argument. Allowed values are 'board', 'miralis', or 'protect'."
exit 1
fi
# Determine ADDRESS based on VALUE
if [[ "$1" == "board" ]]; then
ADDRESS=$BOARD_IP
elif [[ "$1" == "miralis" ]]; then
ADDRESS=$MIRALIS_IP
elif [[ "$1" == "protect" ]]; then
ADDRESS=$PROTECT_PAYLOAD_IP
else
echo "Unknown value: $VALUE"
exit 1
fi
[ -d YCSB ] || git clone http://github.com/brianfrankcooper/YCSB.git
cd YCSB
# Run the mcached benchmark
./bin/ycsb load memcached -s -P workloads/workloada -p "memcached.hosts=$(echo "$ADDRESS" | cut -d'@' -f2-)"
./bin/ycsb run memcached -s -P workloads/workloada -p "memcached.hosts=$(echo "$ADDRESS" | cut -d'@' -f2-)" > ../results/workload_memcached_$1.txt
# Run the redis benchmark
RemoteExec $ADDRESS "redis-cli CONFIG SET protected-mode no"
./bin/ycsb load redis -s -P workloads/workloada -p "redis.host=$(echo "$ADDRESS" | cut -d'@' -f2-)" -p "redis.port=6379"
./bin/ycsb run redis -s -P workloads/workloada -p "redis.host=$(echo "$ADDRESS" | cut -d'@' -f2-)" -p "redis.port=6379" > ../results/workload_redis_$1.txt
cd ..