org.apache.ojb.performance
Class PerfMain

java.lang.Object
  extended by org.apache.ojb.performance.PerfMain

public class PerfMain
extends java.lang.Object

The OJB stress/performance test - a simple performance test application to run O/R mapper in a simulated single/multi-threaded environment.

You have two possibilities to run this test:

- use the OJB build script and call
ant perf-test

- or for standalone use perform the test class by yourself
java -classpath CLASSPATH org.apache.ojb.performance.PerfMain
[comma separated list of PerfTest implementation classes, no blanks!]
[number of test loops, default '5']
[number of threads, default '10']
[number of insert/fetch/delete loops per thread, default '100']
[boolean - run in stress mode if set true, run in performance mode if set false, default 'false']
[boolean - if 'true' all log messages will be print, else only a test summary, default 'true']

For example:

java -classpath CLASSPATH my.MyPerfTest,myMyPerfTest2 3 10 200 false true

Version:
$Id: PerfMain.java 365254 2005-12-30 00:01:42Z arminw $

Constructor Summary
PerfMain()
           
 
Method Summary
 void addConsistentResult(java.lang.String testName, int objectsBefore, int objectsAfter)
           
 void addPeriodResult(java.lang.String testName, long[] resultArr)
          testTimes[0] startTime/test length testTimes[1] inserting times testTimes[2] fetching times testTimes[3] fetching repeat times testTimes[4] get by Identity times testTimes[5] updating times testTimes[6] deleting times
static int getConcurrentThreads()
           
 java.util.Map getExceptionMap()
           
static int getIterationsPerThread()
           
 java.util.Collection getResultList()
           
static int getTestLoops()
           
static boolean isUseStressMode()
           
static void main(java.lang.String[] args)
           
static org.apache.ojb.performance.PerfMain.Printer printer()
           
 void printResult()
           
 void registerException(java.lang.String causer, java.lang.Exception e)
           
 void startPerfTest(java.lang.String[] args)
          Call this to begin the performance test.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerfMain

public PerfMain()
Method Detail

main

public static void main(java.lang.String[] args)

printer

public static org.apache.ojb.performance.PerfMain.Printer printer()

startPerfTest

public void startPerfTest(java.lang.String[] args)
                   throws java.lang.Exception
Call this to begin the performance test.

Throws:
java.lang.Exception

printResult

public void printResult()

addPeriodResult

public void addPeriodResult(java.lang.String testName,
                            long[] resultArr)
testTimes[0] startTime/test length testTimes[1] inserting times testTimes[2] fetching times testTimes[3] fetching repeat times testTimes[4] get by Identity times testTimes[5] updating times testTimes[6] deleting times


addConsistentResult

public void addConsistentResult(java.lang.String testName,
                                int objectsBefore,
                                int objectsAfter)

registerException

public void registerException(java.lang.String causer,
                              java.lang.Exception e)

getExceptionMap

public java.util.Map getExceptionMap()

getResultList

public java.util.Collection getResultList()

getIterationsPerThread

public static int getIterationsPerThread()

getConcurrentThreads

public static int getConcurrentThreads()

isUseStressMode

public static boolean isUseStressMode()

getTestLoops

public static int getTestLoops()


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30