Permalink
Browse files

Makefile rules for running the server and running benchmarks

  • Loading branch information...
jeffjenkins committed Dec 10, 2015
1 parent 455bb2c commit 3906023e9129295daffeb71c5034182802601e1e
Showing with 51 additions and 3 deletions.
  1. +2 −1 .gitignore
  2. +28 −2 Makefile
  3. +8 −0 dev/config.json
  4. +13 −0 scripts/benchmark_helper.sh
View
@@ -1,3 +1,4 @@
*.pb.go
*.cover
*.db
*.db
scripts/external/
View
@@ -1,6 +1,12 @@
.PHONY: all protoc_present deps gen_all gen_pb gen_amqp build test full_coverage \
real_line_count devserver benchmark_dev benchmark
PROTOC := protoc -I=${GOPATH}/src:${GOPATH}/src/github.com/gogo/protobuf/protobuf/:.
RUN_PORT=5672
PERF_SCRIPT=scripts/external/perf-client/runjava.sh
all: build
protoc_present:
@@ -30,12 +36,32 @@ gen_amqp:
build: deps gen_all
go build -o dispatchd github.com/jeffjenkins/dispatchd/server
test: gen_all
test: deps gen_all
go test -cover github.com/jeffjenkins/dispatchd/...
full_coverage: test
# Output: $$GOPATH/all.cover
python scripts/cover.py
real_line_count:
find . | grep '.go$$' | grep -v pb.go | grep -v generated | xargs cat | wc -l
find . | grep '.go$$' | grep -v pb.go | grep -v generated | xargs cat | wc -l
${PERF_SCRIPT}:
mkdir -p scripts/external/
curl -o scripts/external/perf-client.tar.gz 'https://www.rabbitmq.com/releases/rabbitmq-java-client/v3.5.6/rabbitmq-java-client-bin-3.5.6.tar.gz'
tar -C scripts/external/ -zxf scripts/external/perf-client.tar.gz
mv scripts/external/rabbitmq-java-client-bin-3.5.6 scripts/external/perf-client/
devserver: gen_all
go install github.com/jeffjenkins/dispatchd/server
STATIC_PATH=${GOPATH}/src/github.com/jeffjenkins/dispatchd/static \
${GOPATH}/bin/server \
-config-file ${GOPATH}/src/github.com/jeffjenkins/dispatchd/dev/config.json
benchmark_dev: scripts/external/perf-client/runjava.sh
RUN_PORT=1111 scripts/benchmark_helper.sh
benchmark: scripts/external/perf-client/runjava.sh
RUN_PORT=${RUN_PORT} scripts/benchmark_helper.sh
View
@@ -0,0 +1,8 @@
{
"amqp-port" : 1111,
"users" : {
"guest" : {
"password_bcrypt_base64" : "JDJhJDExJENobGk4dG5rY0RGemJhTjhsV21xR3VNNnFZZ1ZqTzUzQWxtbGtyMHRYN3RkUHMuYjF5SUt5"
}
}
}
@@ -0,0 +1,13 @@
#!/bin/bash
set -x
cd scripts/external/perf-client/
./runjava.sh com.rabbitmq.examples.PerfTest \
--exchange perf-test \
-uri amqp://guest:guest@localhost:${RUN_PORT} \
--queue perf-test-transient \
--consumers 4 \
--producers 2 \
--qos 20 \
--time 20

0 comments on commit 3906023

Please sign in to comment.