forked from StreamMachine/StreamMachine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
load_test.sh
41 lines (38 loc) · 1.89 KB
/
load_test.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
#!/bin/sh
#
# run concurrent curls which download from URL to /dev/null. output total
# and average counts to results directory.
#
# max concurrent curls to kick off
max=90
# how long to stay connected (in seconds)
duration=1
# how long to sleep between each curl, can be decimal 0.5
delay=2
# url to request from
URL=http://localhost:8015/kpcclive
#####
#mkdir -p results
echo > results
while /usr/bin/true
do
count=1
while [ $count -le $max ]
do
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
curl -o /dev/null -m $duration -s -w "bytes %{size_download} avg %{speed_download} " -H "icy-metadata: 1" "$URL" >> results &
[ "$delay" != "" ] && sleep $delay
let count=$count+10
done
wait
done
echo done