Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
137 lines (98 sloc) 4.01 KB
# -*- makefile -*-
# This is a makefile for running performance tests
GRINDER_HOME=build/opt/grinder-3.2
# You may need to supply these, in particular on MacOSX.
# MacPorts installs Jython standalone, that is, without the libraries. Really useful!
# So you'll have to install it manually using the installer from http://jython.org/.
# Jython 2.5.1rc1 seems to have broken threading; use 2.2.1 and supply its location:
# make -f Makefile.test JYTHON_HOME=~/bin/jython2.2.1 run-short-thrash-test
PYTHON_HOME ?= /var/lib/python-support/python2.6
JYTHON_HOME ?= /usr/share/jython
# Must be absolute
TMP_DIR:=$(CURDIR)/tmp
PYTHON_CACHEDIR:=${TMP_DIR}/python/cachedir
LOG_DIR:=$(TMP_DIR)/logs
JAVA_CMD:=java
CLASSPATH:=${GRINDER_HOME}/lib/grinder.jar
OS=$(shell if [ -e /etc/redhat-release ]; then echo "redhat"; \
elif [ -e /etc/debian_version ]; then echo "debian"; fi)
JVM_ARGS:=-Dgrinder.logDirectory=$(LOG_DIR)
GRINDER_JVM_ARGS:="-Dpython.cachedir=${PYTHON_CACHEDIR} \
-Dpython.home=${JYTHON_HOME} -Dpython.path=${PYTHON_HOME}"
JAVA_ARGS:=-Dgrinder.jvm.arguments=$(GRINDER_JVM_ARGS) $(JVM_ARGS)
GRINDER_CMD:=${JAVA_CMD} -classpath ${CLASSPATH} $(JAVA_ARGS)
DEB_AND_RPM_DEPENDENCIES:=jython memcached python-nose
DEB_DEPENDENCIES:=$(DEB_AND_RPM_DEPENDENCIES) python-memcache
RPM_DEPENDENCIES:=$(DEB_AND_RPM_DEPENDENCIES) python-memcached
STREAM_DIR ?= test/performance/streams
PROFILE_DIR ?= test/performance/tests
DIR:=$(shell pwd)
# *** Top level targets ***
default:
echo Try a run-* target e.g,. run-short-thrash-test
setup: install-packages install-grinder
install-packages:
ifeq ($(OS),redhat)
$(MAKE) install-rpms
else
$(MAKE) install-debs
endif
install-rpms:
yum install $(RPM_DEPENDENCIES)
install-debs:
- [ -z "`dpkg-query -W -f '$${status}' $(DEB_DEPENDENCIES) 2>&1 | grep -v 'install ok installed'`" ] || \
( sudo apt-get update && sudo apt-get install $(DEB_DEPENDENCIES) )
install-grinder: build/opt/grinder-3.2
build/opt/grinder-3.2:
wget -O build/grinder.zip http://downloads.sourceforge.net/sourceforge/grinder/grinder-3.2.zip
cd build/opt; unzip ../grinder.zip
start-grinder-console:
${GRINDER_CMD} net.grinder.Console &
stop-grinder-console:
# TODO:
stop-grinder-receiver:
# TODO: Variable to tidy up, and catch error for non-existant process
pkill -fx -P \
`pgrep -fx "java.*net.grinder.Grinder.*receiver.properties"` \
".*net.grinder.engine.process.WorkerProcessEntryPoint"
pkill -fx "java.*net.grinder.Grinder.*receiver.properties"
init-rabbit-streams:
make full-reset-core
make start-orchestrator
run-short-thrash-test:
${MAKE} -f Makefile.test TEST=short-thrash STREAM=empty run-perf-test
run-new-thrash-test:
${MAKE} -f Makefile.test TEST=new-thrash STREAM=empty run-perf-test
run-soak-test:
${MAKE} -f Makefile.test TEST=soak STREAM=empty run-perf-test
plot-last-run:
mkdir -p tmp/gnuplot
gnuplot test/performance/gnuplot/plain-receiver.p
gnuplot test/performance/gnuplot/plain-sender.p
awk -f test/performance/gnuplot/calculate-receiver-rate.awk \
tmp/logs/data_receiver-0.log > tmp/gnuplot/receiver-rate.log
awk -f test/performance/gnuplot/timings.awk \
var/log/orchestrator.log > tmp/logs/timings
gnuplot test/performance/gnuplot/rate-receiver.p
gnuplot test/performance/gnuplot/trace.p
# *** End top level targets ***
create-cachedir:
mkdir -p ${PYTHON_CACHEDIR}
chmod a+rw ${PYTHON_CACHEDIR}
start-grinder-receiver: create-cachedir
for r in ${PROFILE_DIR}/${TEST}/receiver*.properties; \
do (${GRINDER_CMD} -Dgrinder.hostID=`basename "$$r" .properties` net.grinder.Grinder \
"$$r" &); \
done
${TMP_DIR}/streams/%: ${STREAM_DIR}/%.js
mkdir -p $@/feedshub_status
./bin/compile.sh $@/feedshub_status $^
init-orchestrator: ${TMP_DIR}/streams/${STREAM}
python sbin/import_config.py ${TMP_DIR}/streams/${STREAM}
make start-orchestrator
#sleep 30 # a chance for the orchestrator to start everything
run-perf-test: create-cachedir
for s in ${PROFILE_DIR}/${TEST}/sender*.properties; \
do (${GRINDER_CMD} -Dgrinder.hostID=`basename "$$s" .properties` net.grinder.Grinder \
"$$s" &); \
done