Page MenuHomec4science

benchmark_http.sh
No OneTemporary

File Metadata

Created
Sun, Apr 28, 03:19

benchmark_http.sh

#!/bin/bash
if [[ $1 == '' ]]; then
echo "USAGE: $0 <cookie phsid>"
exit
fi
URL='https://c4science.ch/diffusion/TEST/repository/master/'
COOK="-C phsid:$1 -C phusr:admin"
ARGS1='-n 1000 -c 20'
ARGS2='-n 1000 -c 2'
DATE=$(date +%s)
ab -g /tmp/gnuplot1.out $COOK $ARGS1 $URL
ab -g /tmp/gnuplot2.out $COOK $ARGS2 $URL
echo "set terminal png
set output 'benchmark_$DATE.png'
set title 'Apache Benchmark $(date +"%d.%m.%Y %H:%M")'
set size 1,1
set grid y
set xlabel 'request'
set ylabel 'response time (ms)'
plot '/tmp/gnuplot1.out' using 9 smooth sbezier with lines title '$ARGS1' \\
, '/tmp/gnuplot2.out' using 9 smooth sbezier with lines title '$ARGS2'" > /tmp/plotme
gnuplot /tmp/plotme
eog benchmark_$DATE.png

Event Timeline