WARNING! Access to this system is limited to authorised users only.
Unauthorised users may be subject to prosecution.
Unauthorised access to this system is a criminal offence under Australian law (Federal Crimes Act 1914 Part VIA)
It is a criminal offence to:
(1) Obtain access to data without authority. -Penalty 2 years imprisonment.
(2) Damage, delete, alter or insert data without authority. -Penalty 10 years imprisonment.
User activity is monitored and recorded. Anyone using this system expressly consents to such monitoring and recording.

To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit a76ca633 authored by steveb-oss's avatar steveb-oss
Browse files

[svn r443] Added daytrader benchmarks: tradebeans and tradesoap

parent bde24511
<project name="tradebeans" default="all" basedir="../..">
<description>DaCapo tradebeans benchmark</description>
<property file="dacapo.properties"/>
<property name="bm-name" value="tradebeans"/>
<import file="../common.xml"/>
<target name="bm-harness">
<javac srcdir="${bm-src-dir}" classpath="${harness-classpath}:${bm-harness-classpath}" destdir="${bm-output-dir}"
includes="**"
debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="bm-build" depends="daytrader"/>
</project>
package org.dacapo.harness;
import java.io.File;
import java.lang.reflect.Method;
import org.dacapo.harness.Benchmark;
import org.dacapo.parser.Config;
/**
* Dacapo benchmark harness for tradebeans.
*
* @author Apache
*
*/
public class Tradebeans extends Benchmark {
private Method initializeMethod;
public Tradebeans(Config config, File scratch) throws Exception {
super(config,scratch);
Class<?> clazz = Class.forName("org.dacapo.daytrader.Launcher", true, loader);
this.initializeMethod = clazz.getMethod("initialize", new Class[] { File.class, Integer.TYPE, String.class, Boolean.TYPE } );
this.method = clazz.getMethod("performIteration", new Class[] { } );
}
@Override
protected void prepare() throws Exception {
unpackZipFileResource("dat/daytrader.zip", scratch);
}
@Override
protected void prepare(String size) throws Exception {
String[] args = preprocessArgs(size);
String dtSize = "medium";
if (args.length == 1)
dtSize = args[0];
initializeMethod.invoke(null, scratch, getThreadCount(config,size), dtSize, true);
}
public void cleanup() {
System.out.println("Shutting down Geronimo...");
if (!isPreserve()) {
deleteTree(new File(scratch,"tradebeans"));
deleteTree(new File(scratch,"geronimo-jetty6-javaee5-2.1.4"));
}
}
public void iterate(String size) throws Exception {
if (isVerbose())
System.out.println("tradebeans benchmark starting");
method.invoke(null);
}
/**
* Stub which exists <b>only</b> to facilitate whole program
* static analysis on a per-benchmark basis. See also the "split-deps"
* ant build target, which is also provided to enable whole program
* static analysis.
*
* @author Eric Bodden
*/
public static void main(String args[]) throws Exception {
// create dummy harness and invoke with dummy arguments
(new Tradebeans(null, null)).run(null, "");
}
}
benchmark tradebeans
class org.dacapo.harness.Tradebeans
thread-model per_cpu
libs "daytrader.jar";
size small args "small"
threads 1
output stdout digest 0xebb11b9e1c56c6ef5620b890cca24ec773301388,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
size default args "medium"
threads 2
output stdout digest 0xfa3e4a1b471247726fb6c3a6f42e5853f2522d22,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
size large args "large"
threads 2
output stdout digest 0xc90792fce1594b4b9ea1b01d593aefe801e6e58b,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
description
short "XXXXX",
long "XXXXX",
copyright "Copyright (C) The Apache Software Foundation",
author "XXXXX Lucene Project Management Committee",
license "Apache Public License",
url "http://lucene.apache.org/",
version "2.1.4",
repeats "XXXXX Single iteration indexes two multi-file documents";
<project name="tradesoap" default="all" basedir="../..">
<description>DaCapo tradesoap benchmark</description>
<property file="dacapo.properties"/>
<property name="bm-name" value="tradesoap"/>
<import file="../common.xml"/>
<target name="bm-harness">
<javac srcdir="${bm-src-dir}" classpath="${harness-classpath}:${bm-harness-classpath}" destdir="${bm-output-dir}"
includes="**"
debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="bm-build" depends="daytrader"/>
</project>
package org.dacapo.harness;
import java.io.File;
import java.lang.reflect.Method;
import org.dacapo.harness.Benchmark;
import org.dacapo.parser.Config;
/**
* Dacapo benchmark harness for tradesoap.
*
* @author Apache
*
*/
public class Tradesoap extends Benchmark {
private Method initializeMethod;
public Tradesoap(Config config, File scratch) throws Exception {
super(config,scratch);
Class<?> clazz = Class.forName("org.dacapo.daytrader.Launcher", true, loader);
this.initializeMethod = clazz.getMethod("initialize", new Class[] { File.class, Integer.TYPE, String.class, Boolean.TYPE } );
this.method = clazz.getMethod("performIteration", new Class[] { } );
}
@Override
protected void prepare() throws Exception {
unpackZipFileResource("dat/daytrader.zip", scratch);
}
@Override
protected void prepare(String size) throws Exception {
String[] args = preprocessArgs(size);
String dtSize = "medium";
if (args.length == 1)
dtSize = args[0];
initializeMethod.invoke(null, scratch, getThreadCount(config,size), dtSize, false);
}
public void cleanup() {
System.out.println("Shutting down Geronimo...");
if (!isPreserve()) {
deleteTree(new File(scratch,"tradesoap"));
deleteTree(new File(scratch,"geronimo-jetty6-javaee5-2.1.4"));
}
}
public void iterate(String size) throws Exception {
if (isVerbose())
System.out.println("tradesoap benchmark starting");
method.invoke(null);
}
/**
* Stub which exists <b>only</b> to facilitate whole program
* static analysis on a per-benchmark basis. See also the "split-deps"
* ant build target, which is also provided to enable whole program
* static analysis.
*
* @author Eric Bodden
*/
public static void main(String args[]) throws Exception {
// create dummy harness and invoke with dummy arguments
(new Tradesoap(null, null)).run(null, "");
}
}
benchmark tradesoap
class org.dacapo.harness.Tradesoap
thread-model per_cpu
libs "daytrader.jar";
size small args "small"
threads 1
output stdout digest 0xebb11b9e1c56c6ef5620b890cca24ec773301388,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
size default args "small"
threads 2
output stdout digest 0x7a214488a9a0f009e8266dc03cbc6742fe1e91cf,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
size large args "medium"
threads 2
output stdout digest 0xc90792fce1594b4b9ea1b01d593aefe801e6e58b,
stderr digest 0xda39a3ee5e6b4b0d3255bfef95601890afd80709;
description
short "XXXXX",
long "XXXXX",
copyright "Copyright (C) The Apache Software Foundation",
author "XXXXX Lucene Project Management Committee",
license "Apache Public License",
url "http://lucene.apache.org/",
version "2.1.4",
repeats "XXXXX Single iteration indexes two multi-file documents";
......@@ -67,16 +67,22 @@
<target name="lusearch" depends="init,harness">
<ant antfile="bms/lusearch/build.xml" target="incremental"/>
</target>
<target name="pmd" depends="init,harness" description="--> build the pmd benchmark">
<target name="pmd" depends="init,harness">
<ant antfile="bms/pmd/build.xml" target="incremental"/>
</target>
<target name="sunflow" depends="init,harness" description="--> build the sunflow benchmark">
<target name="sunflow" depends="init,harness">
<ant antfile="bms/sunflow/build.xml" target="incremental"/>
</target>
<target name="tomcat" depends="init,harness" description="--> build the tomcat benchmark">
<target name="tomcat" depends="init,harness">
<ant antfile="bms/tomcat/build.xml" target="incremental"/>
</target>
<target name="xalan" depends="init,harness" description="--> build the xalan benchmark">
<target name="tradebeans" depends="init,harness">
<ant antfile="bms/tradebeans/build.xml" target="incremental"/>
</target>
<target name="tradesoap" depends="init,harness">
<ant antfile="bms/tradesoap/build.xml" target="incremental"/>
</target>
<target name="xalan" depends="init,harness">
<ant antfile="bms/xalan/build.xml" target="incremental"/>
</target>
</project>
......@@ -8,6 +8,7 @@
# before this file, and will thus override these defaults
#
make=/usr/bin/make
mvn=/usr/bin/mvn
javacchome=/usr/share/java
java14.lib=/usr/lib/j2se/1.4/jre/lib
java14.compile.classpath=${java14.lib}/rt.jar;${java14.lib}/jce.jar;${java14.lib}/jsse.jar
Manifest-Version: 1.0
Main-Class: Harness
Class-Path: scratch/geronimo-jetty6-javaee5-2.1.4/lib/geronimo-kernel-2.1.4.jar scratch/geronimo-jetty6-minimal-2.1.4/lib/geronimo-kernel-2.1.4.jar
\ No newline at end of file
......@@ -2,15 +2,17 @@
<import file="../util.xml"/>
<import file="libs.xml"/>
<property name="lib-build-dir" value="libs/${lib-name}/build"/>
<property name="lib-output-dir" value="libs/${lib-name}/dist"/>
<property name="lib-jars" value="${lib-output-dir}/jar"/>
<property name="lib-downloads" value="libs/${lib-name}/downloads"/>
<property name="lib-src-dir" value="libs/${lib-name}/src"/>
<property name="lib-build-dir" location="libs/${lib-name}/build"/>
<property name="lib-output-dir" location="libs/${lib-name}/dist"/>
<property name="lib-jars" location="${lib-output-dir}/jar"/>
<property name="lib-dat" value="${bm-output-dir}/dat"/>
<property name="lib-downloads" location="libs/${lib-name}/downloads"/>
<property name="lib-src-dir" location="libs/${lib-name}/src"/>
<property name="lib-data" location="libs/${lib-name}/data"/>
<target name="all" depends="source, pre-build, build, jar, complete"/>
<target name="all" depends="url-source, svn-source, pre-build, build, jar, complete"/>
<target name="source" if="lib-src">
<target name="url-source" if="lib-url">
<antcall target="check-source">
<param name="target-dir" value="${lib-downloads}"/>
<param name="target-url" value="${lib-url}"/>
......@@ -18,6 +20,15 @@
</antcall>
</target>
<target name="svn-source" if="lib-svn-url">
<antcall target="check-svn-source">
<param name="target-dir" value="${lib-downloads}"/>
<param name="svn-url" value="${lib-svn-url}"/>
<param name="svn-revison" value="${lib-svn-revision}"/>
<param name="target-file" value="${lib-src}"/>
</antcall>
</target>
<target name="pre-build" depends="clean, init, unpack"/>
<target name="clean">
......@@ -35,7 +46,7 @@
<target name="build"/>
<target name="patch">
<patch patchfile="${lib-name}.patch" dir="${lib-build-dir}" strip="0" ignorewhitespace="yes"/>
<patch patchfile="libs/${lib-name}/${lib-name}.patch" dir="${lib-build-dir}" strip="0" ignorewhitespace="yes"/>
</target>
<target name="untar">
......
<project name="daytrader" default="all" basedir="../..">
<description>daytrader application, required by tradebeans and tradesoap</description>
<property file="ant/dacapo.properties"/>
<property name="lib-name" value="daytrader"/>
<property name="lib-svn-url" value="http://svn.apache.org/repos/asf/geronimo/daytrader/trunk"/>
<property name="lib-svn-revision" value="767347"/>
<property name="lib-version" value="svn-${lib-svn-revision}"/>
<property name="lib-src" value="daytrader-${lib-version}-src.zip"/>
<property name="ger-version" value="2.1.4"/>
<property name="ger-name" value="geronimo-jetty6-javaee5"/>
<property name="ger-url" value="${apache.dl.url}/geronimo/${ger-version}"/>
<property name="ger-bin" value="${ger-name}-${ger-version}-bin.tar.gz"/>
<import file="../common.xml"/>
<property name="dt-build" location="${lib-build-dir}/daytrader"/>
<property name="launcher-build" location="${lib-build-dir}/launcher"/>
<property name="ger-home" location="${lib-build-dir}/${ger-name}-${ger-version}"/>
<property name="ger-cli-jar" value="${ger-home}/lib/geronimo-cli-${ger-version}.jar"/>
<property name="ger-kernel-jar" value="${ger-home}/lib/geronimo-kernel-${ger-version}.jar"/>
<condition property="shell-exe" value="cmd.exe">
<os family="windows"/>
</condition>
<property name="shell-exe" value="sh"/>
<condition property="gsh-exe" value="gsh.bat">
<os family="windows"/>
</condition>
<property name="gsh-exe" value="gsh"/>
<target name="url-source" if="ger-url">
<antcall target="check-source">
<param name="target-dir" value="${lib-downloads}"/>
<param name="target-url" value="${ger-url}"/>
<param name="target-file" value="${ger-bin}"/>
</antcall>
</target>
<target name="unpack">
<untar src="${lib-downloads}/${ger-bin}" dest="${lib-build-dir}" compression="gzip"/>
<patch patchfile="libs/${lib-name}/geronimo-quiet-log.patch" dir="${lib-build-dir}" strip="0" ignorewhitespace="yes"/>
<mkdir dir="${dt-build}"/>
<unzip src="${lib-downloads}/${lib-src}" dest="${dt-build}/"/>
<copy file="${lib-data}/stocks.txt" todir="${dt-build}/modules/ejb/src/main/resources/"/>
<copy file="${lib-data}/users.txt" todir="${dt-build}/modules/ejb/src/main/resources/"/>
<copy file="${lib-data}/workload.txt" todir="${dt-build}/modules/ejb/src/main/resources/"/>
<patch patchfile="libs/${lib-name}/${lib-name}.patch" dir="${dt-build}" strip="0" ignorewhitespace="yes"/>
</target>
<target name="build" depends="data">
<mkdir dir="${launcher-build}/"/>
<javac srcdir="${lib-src-dir}" destdir="${launcher-build}" classpath="${ger-cli-jar}:${ger-kernel-jar}" debug="true" debuglevel="lines,vars,source"/>
</target>
<target name="jar" depends="build">
<jar destfile="${lib-jars}/${lib-name}.jar">
<fileset dir="${launcher-build}">
<include name="**/*.class"/>
</fileset>
</jar>
</target>
<target name="data">
<!-- build daytrader -->
<exec executable="${mvn}" dir="${dt-build}">
<env key="GERONIMO_HOME" value="${ger-home}"/>
<env key="MAVEN_OPTS" value="-Xms256m -Xmx512m"/>
<arg line="clean"/>
<arg line="install"/>
</exec>
<!-- deploy daytrader to geronimo -->
<antcall target="start-geronimo"/>
<antcall target="deploy">
<param name="deploy-subject" value="daytrader-derby-datasource/target/daytrader-derby-datasource-2.2-SNAPSHOT.car"/>
</antcall>
<antcall target="deploy">
<param name="deploy-subject" value="daytrader-jetty/target/daytrader-jetty-2.2-SNAPSHOT.car"/>
</antcall>
<antcall target="deploy">
<param name="deploy-subject" value="daytrader-jetty/target/daytrader-dacapo-2.2-SNAPSHOT.car"/>
</antcall>
<antcall target="deploy">
<param name="deploy-subject" value="daytrader-jetty/target/daytrader-ws-client-2.2-SNAPSHOT.car"/>
</antcall>
<antcall target="stop-geronimo"/>
<!-- package the resulting geronimo install as a zip -->
<zip destfile="${lib-dat}/${lib-name}.zip">
<fileset dir="${lib-build-dir}" includes="${ger-name}-${ger-version}/**"/>
</zip>
</target>
<target name="start-geronimo">
<exec executable="${shell-exe}" dir="${ger-home}" spawn="true">
<env key="GERONIMO_HOME" path="${ger-home}"/>
<arg path="${ger-home}/bin/${gsh-exe}"/>
<arg value="-c"/>
<arg value="geronimo/start-server"/>
</exec>
<echo message="Waiting for geronimo startup..."/>
<waitfor maxwait="2" maxwaitunit="minute" checkevery="1000">
<http url="http://localhost:8080/console/login.jsp"/>
</waitfor>
<echo message="Established connection..."/>
<sleep seconds="1"/>
</target>
<target name="stop-geronimo">
<exec executable="${shell-exe}" dir="${ger-home}">
<env key="GERONIMO_HOME" path="${ger-home}"/>
<arg path="${ger-home}/bin/${gsh-exe}"/>
<arg value="-c"/>
<arg value="geronimo/stop-server -u system -w manager"/>
</exec>
</target>
<target name="deploy">
<exec executable="${shell-exe}" dir="${dt-build}">
<env key="GERONIMO_HOME" path="${ger-home}"/>
<arg path="${ger-home}/bin/${gsh-exe}"/>
<arg value="-c"/>
<arg value="deploy/install-plugin -u system -w manager ${deploy-subject}"/>
</exec>
</target>
</project>
#!/usr/bin/perl
my $user_density = 1.5; # over-provisioning of user set (only use 1/N)
my $ops_per_session_mean = 16;
my $ops_per_session_sd = 8;
my %op_prob = (
"h" => .20, # homepage
"q" => .45, # quote
"l" => 0, # login (implicit)
"o" => 0, # logout (implicit)
"r" => .005, # register a completely new user
"a" => .06, # display account info
"p" => .09, # portfolio
"b" => .09, # buy
"s" => .09, # sell
"u" => .015 # update account profile
);
my $add_to_holdings = 0; # do we update holdings when buying?
my $prob_buy_quoted_stock = 0.75; # typically buy a stock which was quoted
my $prob_sell_quoted_stock = 0.75; # typically sell a stock which was quoted
my $prob_quote_held_stock = 0.60; # typically get quotes on held stock
my $prob_buy_held_stock = 0.50; # often buy held stock
my %op_actual = ();
my $sell_deficit = 0;
my $sep = "\t";
my $maxholdings = 20;
my $stocks_mean = 1000;
my $stocks_sd = 500;
my $stocks_min = 1;
my $minbalance = 90000;
my $maxbalance = 1200000;
my %fullnames = ();
my $firstnamefile = "names-first.txt";
my $familynamefile = "names-family.txt";
my $streetnamefile = "names-street.txt";
my $regionnamefile = "names-region.txt";
my @firstnames = ();
my @lastnames = ();
my @streetnames = ();
my @regionnames = ();
my @usstates = ("AL", "AK", "AS", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FM", "FL", "GA", "GU", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MH", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "MP", "OH", "OK", "OR", "PW", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VI", "VA", "WA", "WV", "WI", "WY");
my @streettypes = ("Street", "Street", "Street", "Avenue", "Place", "Boulevard", "Road");
my @chars=('a'..'z','A'..'Z','0'..'9','_');
my @emaildomains=("gmail.com", "gmail.com", "hotmail.com", "hotmail.com", "yahoo.com", "yahoo.com", "aol.com");
my @surplus_users = ();
my %users = ();
my $output_dir = shift(@ARGV);
my %sessions = ("small" => 32,
"medium" => 256,
"large" => 1024);
my %stockquotes = ();
init($output_dir);
my $max_users = $user_density*($sessions{"large"});
create_users($max_users);
create_operations();
my $total_ops = 0;
foreach $key (keys %op_actual) {
$total_ops += $op_actual{$key};
}
foreach $key (sort keys %op_actual) {
printf "$key %.3f\n", ($op_actual{$key}/$total_ops);
}
exit;
#
#
# initialization
#
#
sub init{
my ($output_dir) = @_;
if ($output_dir eq "") {
die "Need to specify an output directory!";
} else {
system("mkdir -p $output_dir");
}
init_stocks();
}
#
#
# operations
#
#
sub create_operations {
my $output_file = "$output_dir/workload.txt";
my @userset = ();
get_userset(\@userset);
open (OUTPUT, ">$output_file");
my $header = "#$sep";
foreach $key (sort {$sessions{$a} <=> $sessions{$b}} keys %sessions) {
$header .= "$key: ".$sessions{$key}."$sep";
}
print OUTPUT $header."\n";
my $uid;
foreach $uid (@userset) {
my $session = generate_session($uid);
print OUTPUT "$session\n";
}
close OUTPUT;
}
# get a randomized set of $sessions users
sub get_userset {
my ($userset) = @_;
my @taken = ();
my $low = 0;
foreach $key (sort {$sessions{$a} <=> $sessions{$b}} keys %sessions) {
my $high = $sessions{$key};
my $max_uid = $high*$user_density;
for (my $spot = $low; $spot < $high; $spot++) {
my $u = int (rand $max_uid);
while ($taken[$u]) {
$u++;
if ($u == $max_uid) { $u = 0; }
}
$$userset[$spot] = sprintf("%.6d",$u);
$taken[$u] = 1;
}
$low = $high;
}
}