-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_latency.sh
executable file
·49 lines (32 loc) · 1.97 KB
/
test_latency.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
#!/bin/sh
if [ "$#" -lt 1 ]; then
echo "Usage: test_latency.sh http://{HOST}:{PORT}"
exit 1
fi
echo "AVERAGE LATENCY TEST: TIME(SEC)"
echo ""
PART=`./bin/thor.py $1 -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for DIRECTORY LISTING /WWW: $PART"
PART=`./bin/thor.py $1/html -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for DIRECTORY LISTING /WWW/HTML: $PART"
PART=`./bin/thor.py $1/images -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for DIRECTORY LISTING /WWW/IMAGES: $PART"
PART=`./bin/thor.py $1/scripts -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for DIRECTORY LISTING /WWW/SCRIPTS: $PART"
echo ""
PART=`./bin/thor.py $1/html/index.html -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for STATIC FILES /WWW/HTML/index.html: $PART"
PART=`./bin/thor.py $1/images/a.png -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for STATIC FILES /WWW/IMAGES/a.png: $PART"
PART=`./bin/thor.py $1/images/b.png -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for STATIC FILES /WWW/IMAGES/b.png: $PART"
PART=`./bin/thor.py $1/song.txt -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for STATIC FILES /WWW/song.txt: $PART"
echo""
PART=`./bin/thor.py $1/scripts/hello.py -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for CGI SCRIPTS /WWW/SCRIPTS/hello.py: $PART"
PART=`./bin/thor.py $1/scripts/cowsay.sh -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for CGI SCRIPTS /WWW/SCRIPTS/cowsay.sh: $PART"
PART=`./bin/thor.py $1/scripts/env.sh -t 5 -h 5 | grep "TIME" | sed -En "s/^.*([0-9]+\.[0-9]+)$/\1/p"`
echo "Average Latency for CGI SCRIPTS /WWW/SCRIPTS/env.sh: $PART"
exit 0