Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added better java test, integrated test and sample result
- Loading branch information
Vincent Landgraf
committed
Apr 2, 2011
1 parent
25d1d73
commit 6218fb2
Showing
7 changed files
with
78 additions
and
19 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,19 +1,46 @@ | |||
COUNT = 10000 | COUNT = 10 | ||
URL = "http://localhost/~vincentlandgraf/test.json" | URL = "http://localhost/~vincentlandgraf/test.json" | ||
DATE = `date +%Y-%m-%d.%H-%M` | |||
RESULT = "result-$(DATE).txt" | |||
|
|
||
all: install test-ruby test-java test-apache | all: clean install test csv | ||
|
|
||
install: | clean: | ||
rm -f $(RESULT) | |||
|
|||
# | |||
# Install the environment | |||
# | |||
|
|||
install: install-ruby install-java | |||
|
|||
install-ruby: | |||
rvm 1.9.2,1.8.7 exec bundle install | rvm 1.9.2,1.8.7 exec bundle install | ||
|
|||
install-java: | |||
cd java && mvn clean && mvn package | cd java && mvn clean && mvn package | ||
|
|
||
# | |||
# Do the test | |||
# | |||
|
|||
test: test-ruby test-java test-apache | |||
|
|||
test-ruby: | test-ruby: | ||
rvm 1.9.2,1.8.7 exec ruby test.rb $(COUNT) $(URL) | rvm 1.9.2,1.8.7 exec ruby test.rb $(COUNT) $(URL) >> $(RESULT) | ||
|
|
||
test-java: | test-java: | ||
java -version | java -version | ||
java -server -jar java/target/http-test-0.0.1-SNAPSHOT.jar $(COUNT) $(URL) | java -server -jar java/target/http-test-0.0.1-SNAPSHOT.jar $(COUNT) $(URL) >> $(RESULT) | ||
java -jar java/target/http-test-0.0.1-SNAPSHOT.jar $(COUNT) $(URL) | java -jar java/target/http-test-0.0.1-SNAPSHOT.jar $(COUNT) $(URL) >> $(RESULT) | ||
|
|
||
test-apache: | test-apache: | ||
ab -n $(COUNT) $(URL) | ab -n $(COUNT) $(URL) >> $(RESULT) | ||
|
|||
# | |||
# Extract the results | |||
# | |||
|
|||
csv: | |||
awk -F" " -f extract.awk $(RESULT) > $(RESULT).csv | |||
open $(RESULT).csv -a numbers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
#!/usr/bin/awk | |||
|
|||
# headlines | |||
/Java|ruby 1|ApacheBench/ { | |||
} | |||
|
|||
# results | |||
/^testing/ { | |||
# use same decimal delimiters everywhere | |||
gsub(/\./, ",", $0); | |||
|
|||
# remove unnecessary chars | |||
gsub(/^testing[ ]*/, "", $0) | |||
gsub(/[()]/, "", $0); | |||
gsub(/[ ]+/, ";", $0); | |||
|
|||
} | |||
|
|||
/Time taken for tests:/ { | |||
print "ab;;;;" $5 | |||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters