User: d_jencks
Date: 01/09/19 12:16:54
Modified: src/main/org/jboss/test/perf/test PerfStressTestCase.java
SecurePerfStressTestCase.java Setup.java
Log:
Changed stress tests to have counts set from build.xml. You may set values in a
local.properties file.
Revision Changes Path
1.3 +42 -39
jbosstest/src/main/org/jboss/test/perf/test/PerfStressTestCase.java
Index: PerfStressTestCase.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/test/PerfStressTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PerfStressTestCase.java 2001/09/17 17:33:53 1.2
+++ PerfStressTestCase.java 2001/09/19 19:16:54 1.3
@@ -35,15 +35,18 @@
/** Test of EJB call invocation overhead.
@author [EMAIL PROTECTED]
- @version $Revision: 1.2 $
+ @version $Revision: 1.3 $
*/
public class PerfStressTestCase extends JBossTestCase
{
- static int N = 1000;
+ int iterationCount;
+ int beanCount;
public PerfStressTestCase(String name)
{
super(name);
+ iterationCount = getIterationCount();
+ beanCount = getBeanCount();
}
public void testClientSession() throws Exception
@@ -70,7 +73,7 @@
bean.remove(0, 100);
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug("Elapsed time = "+(elapsed / N));
+ getLog().debug("Elapsed time = "+(elapsed / iterationCount));
}
public void testTimings() throws Exception
@@ -172,144 +175,144 @@
private void noop(Probe bean) throws Exception
{
- getLog().debug("Starting "+N+" noop() invocations");
+ getLog().debug("Starting "+iterationCount+" noop() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
bean.noop();
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" noop() invocations = "+elapsed+" ms, "+(elapsed / N)+"
ms/noop");
+ getLog().debug(iterationCount+" noop() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/noop");
}
private void ping(Probe bean) throws Exception
{
- getLog().debug("Starting "+N+" ping(PING) invocations");
+ getLog().debug("Starting "+iterationCount+" ping(PING) invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
bean.ping("PING");
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" ping() invocations = "+elapsed+" ms, "+(elapsed / N)+"
ms/noop");
+ getLog().debug(iterationCount+" ping() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/noop");
}
private void echo(Probe bean) throws Exception
{
- getLog().debug("Starting "+N+" echo(ECHO) invocations");
+ getLog().debug("Starting "+iterationCount+" echo(ECHO) invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.echo("ECHO");
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" echo() invocations = "+elapsed+" ms, "+(elapsed / N)+"
ms/noop");
+ getLog().debug(iterationCount+" echo() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/noop");
}
private void txRequired(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txRequired() invocations");
+ getLog().debug("Starting "+iterationCount+" txRequired() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txRequired();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txRequired() invocations = "+elapsed+" ms, "+(elapsed /
N)+" ms/txRequired");
+ getLog().debug(iterationCount+" txRequired() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/txRequired");
}
private void txRequiresNew(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txRequired() invocations");
+ getLog().debug("Starting "+iterationCount+" txRequired() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txRequiresNew();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txRequiresNew() invocations = "+elapsed+" ms, "+(elapsed /
N)+" ms/txRequiresNew");
+ getLog().debug(iterationCount+" txRequiresNew() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/txRequiresNew");
}
private void txSupports(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txSupports() invocations");
+ getLog().debug("Starting "+iterationCount+" txSupports() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txSupports();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txSupports() invocations = "+elapsed+" ms, "+(elapsed /
N)+" ms/txSupports");
+ getLog().debug(iterationCount+" txSupports() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/txSupports");
}
private void txNotSupported(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txNotSupported() invocations");
+ getLog().debug("Starting "+iterationCount+" txNotSupported() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txNotSupported();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txNotSupported() invocations = "+elapsed+" ms, "+(elapsed
/ N)+" ms/txNotSupported");
+ getLog().debug(iterationCount+" txNotSupported() invocations = "+elapsed+"
ms, "+(elapsed / iterationCount)+" ms/txNotSupported");
}
private void requiredToSupports(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" requiredToSupports() invocations");
+ getLog().debug("Starting "+iterationCount+" requiredToSupports()
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.requiredToSupports();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" requiredToSupports() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/requiredToSupports");
+ getLog().debug(iterationCount+" requiredToSupports() invocations =
"+elapsed+" ms, "+(elapsed / iterationCount)+" ms/requiredToSupports");
}
private void requiredToMandatory(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" requiredToMandatory() invocations");
+ getLog().debug("Starting "+iterationCount+" requiredToMandatory()
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.requiredToMandatory();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" requiredToMandatory() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/requiredToMandatory");
+ getLog().debug(iterationCount+" requiredToMandatory() invocations =
"+elapsed+" ms, "+(elapsed / iterationCount)+" ms/requiredToMandatory");
}
private void requiredToRequiresNew(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" requiredToRequiresNew() invocations");
+ getLog().debug("Starting "+iterationCount+" requiredToRequiresNew()
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.requiredToRequiresNew();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" requiredToRequiresNew() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/requiredToRequiresNew");
+ getLog().debug(iterationCount+" requiredToRequiresNew() invocations =
"+elapsed+" ms, "+(elapsed / iterationCount)+" ms/requiredToRequiresNew");
}
private void findByPrimaryKey(EntityPK key, EntityHome home) throws Exception
{
- getLog().debug("Starting "+N+" findByPrimaryKey(key="+key+") invocations");
+ getLog().debug("Starting "+iterationCount+" findByPrimaryKey(key="+key+")
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
Entity bean = home.findByPrimaryKey(key);
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" findByPrimaryKey() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/findByPrimaryKey");
+ getLog().debug(iterationCount+" findByPrimaryKey() invocations = "+elapsed+"
ms, "+(elapsed / iterationCount)+" ms/findByPrimaryKey");
}
private void findByPrimaryKey(Entity2PK key, Entity2Home home) throws Exception
{
- getLog().debug("Starting "+N+" findByPrimaryKey(key="+key+") invocations");
+ getLog().debug("Starting "+iterationCount+" findByPrimaryKey(key="+key+")
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
Entity bean = home.findByPrimaryKey(key);
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" findByPrimaryKey() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/findByPrimaryKey");
+ getLog().debug(iterationCount+" findByPrimaryKey() invocations = "+elapsed+"
ms, "+(elapsed / iterationCount)+" ms/findByPrimaryKey");
}
public static Test suite()
1.3 +42 -42
jbosstest/src/main/org/jboss/test/perf/test/SecurePerfStressTestCase.java
Index: SecurePerfStressTestCase.java
===================================================================
RCS file:
/cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/test/SecurePerfStressTestCase.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SecurePerfStressTestCase.java 2001/09/17 17:33:53 1.2
+++ SecurePerfStressTestCase.java 2001/09/19 19:16:54 1.3
@@ -36,16 +36,19 @@
/** Test of EJB call invocation overhead in the presence of EJB security.
@author [EMAIL PROTECTED]
- @version $Revision: 1.2 $
+ @version $Revision: 1.3 $
*/
public class SecurePerfStressTestCase extends JBossTestCase
{
- static int N = 1000;
+ int iterationCount;
+ int beanCount;
static LoginContext lc = null;
public SecurePerfStressTestCase(String name)
{
super(name);
+ iterationCount = getIterationCount();
+ beanCount = getBeanCount();
}
public void testClientSession() throws Exception
@@ -72,7 +75,7 @@
bean.remove(0, 100);
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug("Elapsed time = "+(elapsed / N));
+ getLog().debug("Elapsed time = "+(elapsed / iterationCount));
}
public void testTimings() throws Exception
@@ -93,7 +96,6 @@
public void testTimingsCMT() throws Exception
{
getLog().debug("+++ testTimingsCMT()");
- InitialContext jndiContext = new InitialContext();
Object obj = getInitialContext().lookup("secure/perf/ProbeCMT");
obj = PortableRemoteObject.narrow(obj, ProbeHome.class);
ProbeHome home = (ProbeHome) obj;
@@ -126,8 +128,6 @@
public void testFindByPrimaryKey() throws Exception
{
getLog().debug("+++ testFindByPrimaryKey()");
-
- InitialContext jndiContext = new InitialContext();
Object obj = getInitialContext().lookup("secure/perf/Entity");
obj = PortableRemoteObject.narrow(obj, EntityHome.class);
EntityHome home = (EntityHome) obj;
@@ -177,144 +177,144 @@
private void noop(Probe bean) throws Exception
{
- getLog().debug("Starting "+N+" noop() invocations");
+ getLog().debug("Starting "+iterationCount+" noop() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
bean.noop();
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" noop() invocations = "+elapsed+" ms, "+(elapsed / N)+"
ms/noop");
+ getLog().debug(iterationCount+" noop() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/noop");
}
private void ping(Probe bean) throws Exception
{
- getLog().debug("Starting "+N+" ping(PING) invocations");
+ getLog().debug("Starting "+iterationCount+" ping(PING) invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
bean.ping("PING");
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" ping() invocations = "+elapsed+" ms, "+(elapsed / N)+"
ms/noop");
+ getLog().debug(iterationCount+" ping() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/noop");
}
private void echo(Probe bean) throws Exception
{
- getLog().debug("Starting "+N+" echo(ECHO) invocations");
+ getLog().debug("Starting "+iterationCount+" echo(ECHO) invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.echo("ECHO");
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" echo() invocations = "+elapsed+" ms, "+(elapsed / N)+"
ms/noop");
+ getLog().debug(iterationCount+" echo() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/noop");
}
private void txRequired(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txRequired() invocations");
+ getLog().debug("Starting "+iterationCount+" txRequired() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txRequired();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txRequired() invocations = "+elapsed+" ms, "+(elapsed /
N)+" ms/txRequired");
+ getLog().debug(iterationCount+" txRequired() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/txRequired");
}
private void txRequiresNew(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txRequired() invocations");
+ getLog().debug("Starting "+iterationCount+" txRequired() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txRequiresNew();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txRequiresNew() invocations = "+elapsed+" ms, "+(elapsed /
N)+" ms/txRequiresNew");
+ getLog().debug(iterationCount+" txRequiresNew() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/txRequiresNew");
}
private void txSupports(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txSupports() invocations");
+ getLog().debug("Starting "+iterationCount+" txSupports() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txSupports();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txSupports() invocations = "+elapsed+" ms, "+(elapsed /
N)+" ms/txSupports");
+ getLog().debug(iterationCount+" txSupports() invocations = "+elapsed+" ms,
"+(elapsed / iterationCount)+" ms/txSupports");
}
private void txNotSupported(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" txNotSupported() invocations");
+ getLog().debug("Starting "+iterationCount+" txNotSupported() invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.txNotSupported();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" txNotSupported() invocations = "+elapsed+" ms, "+(elapsed
/ N)+" ms/txNotSupported");
+ getLog().debug(iterationCount+" txNotSupported() invocations = "+elapsed+"
ms, "+(elapsed / iterationCount)+" ms/txNotSupported");
}
private void requiredToSupports(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" requiredToSupports() invocations");
+ getLog().debug("Starting "+iterationCount+" requiredToSupports()
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.requiredToSupports();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" requiredToSupports() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/requiredToSupports");
+ getLog().debug(iterationCount+" requiredToSupports() invocations =
"+elapsed+" ms, "+(elapsed / iterationCount)+" ms/requiredToSupports");
}
private void requiredToMandatory(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" requiredToMandatory() invocations");
+ getLog().debug("Starting "+iterationCount+" requiredToMandatory()
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.requiredToMandatory();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" requiredToMandatory() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/requiredToMandatory");
+ getLog().debug(iterationCount+" requiredToMandatory() invocations =
"+elapsed+" ms, "+(elapsed / iterationCount)+" ms/requiredToMandatory");
}
private void requiredToRequiresNew(TxSession bean) throws Exception
{
- getLog().debug("Starting "+N+" requiredToRequiresNew() invocations");
+ getLog().debug("Starting "+iterationCount+" requiredToRequiresNew()
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
String echo = bean.requiredToRequiresNew();
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" requiredToRequiresNew() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/requiredToRequiresNew");
+ getLog().debug(iterationCount+" requiredToRequiresNew() invocations =
"+elapsed+" ms, "+(elapsed / iterationCount)+" ms/requiredToRequiresNew");
}
private void findByPrimaryKey(EntityPK key, EntityHome home) throws Exception
{
- getLog().debug("Starting "+N+" findByPrimaryKey(key="+key+") invocations");
+ getLog().debug("Starting "+iterationCount+" findByPrimaryKey(key="+key+")
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
Entity bean = home.findByPrimaryKey(key);
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" findByPrimaryKey() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/findByPrimaryKey");
+ getLog().debug(iterationCount+" findByPrimaryKey() invocations = "+elapsed+"
ms, "+(elapsed / iterationCount)+" ms/findByPrimaryKey");
}
private void findByPrimaryKey(Entity2PK key, Entity2Home home) throws Exception
{
- getLog().debug("Starting "+N+" findByPrimaryKey(key="+key+") invocations");
+ getLog().debug("Starting "+iterationCount+" findByPrimaryKey(key="+key+")
invocations");
long start = System.currentTimeMillis();
- for(int n = 0; n < N; n ++)
+ for(int n = 0; n < iterationCount; n ++)
{
Entity bean = home.findByPrimaryKey(key);
}
long end = System.currentTimeMillis();
long elapsed = end - start;
- getLog().debug(N+" findByPrimaryKey() invocations = "+elapsed+" ms,
"+(elapsed / N)+" ms/findByPrimaryKey");
+ getLog().debug(iterationCount+" findByPrimaryKey() invocations = "+elapsed+"
ms, "+(elapsed / iterationCount)+" ms/findByPrimaryKey");
}
public static Test suite()
1.7 +5 -5 jbosstest/src/main/org/jboss/test/perf/test/Setup.java
Index: Setup.java
===================================================================
RCS file: /cvsroot/jboss/jbosstest/src/main/org/jboss/test/perf/test/Setup.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Setup.java 2001/09/18 22:00:44 1.6
+++ Setup.java 2001/09/19 19:16:54 1.7
@@ -34,7 +34,7 @@
/** Setup utility class.
@author [EMAIL PROTECTED]
- @version $Revision: 1.6 $
+ @version $Revision: 1.7 $
*/
public class Setup extends JBossTestSetup
{
@@ -58,14 +58,14 @@
login();
}
deployJ2ee(filename);
- createEntityBeans(1000);
- createEntity2Beans(1000);
+ createEntityBeans(getBeanCount());
+ createEntity2Beans(getBeanCount());
}
protected void tearDown() throws Exception
{
getLog().debug("+++ Performing the TestSuite tear down");
- removeEntityBeans(1000);
- removeEntity2Beans(1000);
+ removeEntityBeans(getBeanCount());
+ removeEntity2Beans(getBeanCount());
undeployJ2ee(filename);
if( isSecure )
{
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development