Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from VoltDB/ENG-3312
Add measure overhead benchmark for ENG-3312.
- Loading branch information
Showing
11 changed files
with
584 additions
and
0 deletions.
There are no files selected for viewing
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE store | ||
( | ||
key bigint not null | ||
, value varbinary(1048576) not null | ||
, PRIMARY KEY (key) | ||
); | ||
|
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0"?> | ||
<deployment> | ||
<cluster hostcount="1" sitesperhost="3" kfactor="0" /> | ||
<httpd enabled="true"> | ||
<jsonapi enabled="true" /> | ||
</httpd> | ||
</deployment> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | ||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | ||
<appender name="voltfile" class="org.apache.log4j.FileAppender"> | ||
<param name="File" value="key-value-client.log" /> | ||
<param name="ImmediateFlush" value="true" /> | ||
<layout class="org.apache.log4j.PatternLayout"> | ||
<param name="ConversionPattern" | ||
value="%-5p %d{ISO8601} [%t] %c: %m%n"/> | ||
</layout> | ||
</appender> | ||
<appender name="Console" class="org.apache.log4j.ConsoleAppender"> | ||
<param name="Target" value="System.out" /> | ||
<layout class="org.apache.log4j.PatternLayout"> | ||
<param name="ConversionPattern" | ||
value="%-5p %d{ISO8601} [%t] %c: %m%n"/> | ||
</layout> | ||
</appender> | ||
<appender name="Async" class="org.apache.log4j.AsyncAppender"> | ||
<param name="Blocking" value="true" /> | ||
<appender-ref ref="Console" /> | ||
<appender-ref ref="voltfile" /> | ||
</appender> | ||
<root> | ||
<priority value="info" /> | ||
<appender-ref ref="Async" /> | ||
</root> | ||
</log4j:configuration> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> | ||
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> | ||
<appender name="voltfile" class="org.apache.log4j.FileAppender"> | ||
<param name="File" value="key-value-server.log" /> | ||
<param name="ImmediateFlush" value="true" /> | ||
<layout class="org.apache.log4j.PatternLayout"> | ||
<param name="ConversionPattern" | ||
value="%-5p %d{ISO8601} [%t] %c: %m%n"/> | ||
</layout> | ||
</appender> | ||
<appender name="Console" class="org.apache.log4j.ConsoleAppender"> | ||
<param name="Target" value="System.out" /> | ||
<layout class="org.apache.log4j.PatternLayout"> | ||
<param name="ConversionPattern" | ||
value="%-5p %d{ISO8601} [%t] %c: %m%n"/> | ||
</layout> | ||
</appender> | ||
<appender name="Async" class="org.apache.log4j.AsyncAppender"> | ||
<param name="Blocking" value="true" /> | ||
<appender-ref ref="Console" /> | ||
<appender-ref ref="voltfile" /> | ||
</appender> | ||
<root> | ||
<priority value="info" /> | ||
<appender-ref ref="Async" /> | ||
</root> | ||
</log4j:configuration> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0"?> | ||
<project> | ||
<database> | ||
<schemas> | ||
<schema path='ddl.sql' /> | ||
</schemas> | ||
<procedures> | ||
<procedure class='overhead.procedures.NoArgs' /> | ||
<procedure class='overhead.procedures.BinaryPayload' /> | ||
<procedure class='overhead.procedures.NoArgsRW' /> | ||
<procedure class='overhead.procedures.BinaryPayloadRW' /> | ||
</procedures> | ||
<partitions> | ||
<partition table='store' column='key' /> | ||
</partitions> | ||
</database> | ||
</project> |
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
#!/usr/bin/env bash | ||
|
||
APPNAME="overhead" | ||
CLASSPATH="`ls -x ../../../voltdb/voltdb-*.jar | tr '[:space:]' ':'``ls -x ../../../lib/*.jar | tr '[:space:]' ':'`" | ||
VOLTDB="../../../bin/voltdb" | ||
VOLTCOMPILER="../../../bin/voltcompiler" | ||
LOG4J="`pwd`/../../../voltdb/log4j.xml" | ||
LICENSE="../../../voltdb/license.xml" | ||
LEADER="localhost" | ||
|
||
# remove build artifacts | ||
function clean() { | ||
rm -rf obj debugoutput $APPNAME.jar voltdbroot voltdbroot | ||
} | ||
|
||
# compile the source code for procedures and the client | ||
function srccompile() { | ||
mkdir -p obj | ||
javac -classpath $CLASSPATH -d obj \ | ||
src/overhead/*.java \ | ||
src/overhead/procedures/*.java | ||
# stop if compilation fails | ||
if [ $? != 0 ]; then exit; fi | ||
} | ||
|
||
# build an application catalog | ||
function catalog() { | ||
srccompile | ||
$VOLTCOMPILER obj project.xml $APPNAME.jar | ||
# stop if compilation fails | ||
if [ $? != 0 ]; then exit; fi | ||
} | ||
|
||
# run the voltdb server locally | ||
function server() { | ||
# if a catalog doesn't exist, build one | ||
if [ ! -f $APPNAME.jar ]; then catalog; fi | ||
# run the server | ||
$VOLTDB create catalog $APPNAME.jar deployment deployment.xml \ | ||
license $LICENSE leader $LEADER | ||
} | ||
|
||
# run the client that drives the example | ||
function client() { | ||
async-benchmark | ||
} | ||
|
||
# Asynchronous benchmark sample | ||
# Use this target for argument help | ||
function async-benchmark-help() { | ||
srccompile | ||
java -classpath obj:$CLASSPATH:obj overhead.AsyncBenchmark --help | ||
} | ||
|
||
function async-benchmark() { | ||
srccompile | ||
java -classpath obj:$CLASSPATH:obj -Dlog4j.configuration=file://$LOG4J \ | ||
overhead.AsyncBenchmark \ | ||
--displayinterval=5 \ | ||
--duration=60 \ | ||
--operation=BinaryPayloadRW \ | ||
--servers=localhost \ | ||
--port=21212 \ | ||
--resultsize=0 \ | ||
--paramsize=0 \ | ||
--ratelimit=900000 | ||
} | ||
|
||
|
||
|
||
function help() { | ||
echo "Usage: ./run.sh {clean|catalog|server|async-benchmark|aysnc-benchmark-help|...}" | ||
} | ||
|
||
# Run the target passed as the first arg on the command line | ||
# If no first arg, run server | ||
if [ $# -gt 1 ]; then help; exit; fi | ||
if [ $# = 1 ]; then $1; else server; fi |
Oops, something went wrong.