Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 60 lines (52 sloc) 0.94 kb
#!/usr/bin/env bash
ABFLAGS=${ABFLAGS-"-n 2000 -c 50 -k"}
ADDR=${ADDR-http://0.0.0.0:3000/}
AB=${AB-ab}
#
# Log <msg ...>
#
# <msg ...>
#
log(){
echo "... $@"
}
#
# Benchmark the given <dir> and [path].
#
# <dir> [path]
#
bm(){
local dir=$1;
local path=${2-/};
for file in benchmarks/$dir/*; do
log running $file
case $file in
*.js)
node $file &
sleep 2
;;
*.thin.ru)
thin -R $file -p 3000 start &
sleep 2
;;
*.mongrel.ru)
rackup $file -p 3000 -s mongrel &
sleep 2
;;
esac
local pid=$!
local dirname=results/$(dirname $file)
mkdir -p $dirname
$AB $ABFLAGS -g results/$file.dat $ADDR/$path > results/$file.out
log $(cat results/$file.out | grep Requests)
kill -9 $pid
done
}
# Make ./results
mkdir -p results
# Store flags
echo $ABFLAGS > results/flags
# Run benchmarks
log $AB $ABFLAGS $ADDR
bm hello-world
bm static /jquery.js
Jump to Line
Something went wrong with that request. Please try again.