-
Notifications
You must be signed in to change notification settings - Fork 2
/
run.sh
executable file
·35 lines (29 loc) · 1.05 KB
/
run.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
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Need to pass output tag"
exit 1
fi
mkdir -p "output/$1"
concurrencies=(1 2 4 6 8 12)
server="http://localhost:8080"
for concurrency in "${concurrencies[@]}"
do
echo "Running '/' with $concurrency concurrency..."
h2load --h1 --no-tls-proto=http/1.1 -D 30 "$server/" -t $concurrency -c $concurrency > "output/$1/$1-$concurrency.txt"
done
for concurrency in "${concurrencies[@]}"
do
echo "Running '/user/:id' with $concurrency concurrency..."
random=$[$RANDOM % 2048 + 1024]
h2load --h1 --no-tls-proto=http/1.1 -D 30 "$server/user/$random" -t $concurrency -c $concurrency > "output/$1/$1-$concurrency-user-$random.txt"
done
for concurrency in "${concurrencies[@]}"
do
# read in 10kb
data="$(dd if=/dev/urandom bs=1k count=10)"
echo $data > data.txt
echo "Running '/user' with $concurrency concurrency..."
random=$[$RANDOM % 2048 + 1024]
h2load --h1 --no-tls-proto=http/1.1 -D 30 -d data.txt "$server/user" -t $concurrency -c $concurrency > "output/$1/$1-$concurrency-post-$random.txt"
rm data.txt
done