blob: 0b6f7a33c37c3f800abc557344c726cbcde444b2 (
plain)
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
|
ENDPOINT="https://www.cakeside.com/"
REQUEST_COUNT="100"
THREAD_COUNT="10"
FILENAME="$REQUEST_COUNT.$THREAD_COUNT.$(date +%s)"
mkdir -p tmp/data
# run apache bench performance test
# -k means keep connections alive
echo "/usr/sbin/ab -n $REQUEST_COUNT -c $THREAD_COUNT -g "tmp/data/$FILENAME.dat" $ENDPOINT"
/usr/sbin/ab -n $REQUEST_COUNT -c $THREAD_COUNT -g "tmp/data/$FILENAME.dat" $ENDPOINT
# ctime: Connection Time
# dtime: Processing Time
# ttime: Total Time
# wait: Waiting Time
mkdir -p tmp/graphs
# create graph
gnuplot << EOF
# output as png image
set terminal png
# save file to "results.png"
set output "tmp/graphs/$FILENAME.png"
# graph title
set title "$REQUEST_COUNT requests on $THREAD_COUNT thread(s)"
# nicer aspect ratio for image size
set size 1,0.7
# y-axis grid
set grid y
# x-axis label
set xlabel "Request"
# y-axis label
set ylabel "Total time (ms)"
#'unique', 'frequency', 'cumulative', 'cnormal', 'kdensity', 'acsplines', 'csplines', 'bezier' or 'sbezier'
plot "data/$FILENAME.dat" using 9 smooth frequency with lines title "frequency"
EOF
echo "\nResults are in $FILENAME.png\n"
|