Skip to content

Instantly share code, notes, and snippets.

@abn
Created April 16, 2015 00:32
Show Gist options
  • Select an option

  • Save abn/9cbffdfd1f5cb7f7c3e4 to your computer and use it in GitHub Desktop.

Select an option

Save abn/9cbffdfd1f5cb7f7c3e4 to your computer and use it in GitHub Desktop.
Apache ActiveMQ performance testing. To run: `make run AMQ_TARGET=localhost`.
AMQ_VERSION := 5.11.1
AMQ_DIR := activemq-activemq-$(AMQ_VERSION)
AMQ_TAR := activemq-$(AMQ_VERSION).tar.gz
AMQ_TAR_URL := https://github.com/apache/activemq/archive/$(AMQ_TAR)
PERF_DIR := activemq-perftest
PERF_URL := http://svn.apache.org/repos/asf/activemq/sandbox/$(PERF_DIR)
AMQ_TARGET ?= localhost
all: $(AMQ_DIR) $(PERF_DIR)
$(PERF_DIR):
svn co $(PERF_URL)
for sub in "5.7.0" "5.8-SNAPSHOT"; do \
sed -i s/"$${sub}"/"$(AMQ_VERSION)"/ $(PERF_DIR)/pom.xml; \
done
touch $(PERF_DIR)
$(AMQ_TAR):
wget $(AMQ_TAR_URL)
$(AMQ_DIR): $(AMQ_TAR)
tar xf $(AMQ_TAR)
cd $(AMQ_DIR)/activemq-tooling && mvn clean install
touch $(AMQ_DIR)
run: $(PERF_DIR) $(AMQ_DIR)
( cd $(PERF_DIR); mvn activemq-perf:consumer -Dfactory.brokerURL=tcp://$(AMQ_TARGET):61616 > consumer.log 2>&1 & )
( cd $(PERF_DIR); mvn activemq-perf:producer -Dfactory.brokerURL=tcp://$(AMQ_TARGET):61616 > producer.log 2>&1 & )
cd $(PERF_DIR) && tail -f *.log
# Phony targets for cleanup and similar uses
#
# .PHONY: clean
clean:
rm -f $(AMQ_TAR)
rm -rf $(AMQ_DIR) $(PERF_DIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment