org.prevayler.demos.scalability
Class TransactionTestRun

java.lang.Object
  extended by org.prevayler.demos.scalability.TransactionTestRun

public class TransactionTestRun
extends Object

Tests insert, update and delete scalability.


Field Summary
protected  int numberOfObjects
           
 
Constructor Summary
TransactionTestRun(ScalabilityTestSubject subject, int numberOfObjects, int minThreads, int maxThreads)
           
 
Method Summary
protected  void executeOperation(Object connection, long operationSequence)
          Deletes records from id zero to id halfTheObjects - 1.
 double getOperationsPerSecond()
           
 String getResult()
           
protected  String name()
           
protected  void prepare()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberOfObjects

protected final int numberOfObjects
Constructor Detail

TransactionTestRun

public TransactionTestRun(ScalabilityTestSubject subject,
                          int numberOfObjects,
                          int minThreads,
                          int maxThreads)
Method Detail

name

protected String name()
Returns:
The name of the test to be executed. Example: "Prevayler Query Test".

prepare

protected void prepare()

executeOperation

protected void executeOperation(Object connection,
                                long operationSequence)
Deletes records from id zero to id halfTheObjects - 1. Updates records from id halfTheObjects to id numberOfObjects - 1. Inserts records from id numberOfObjects to id numberOfObjects + halfTheObjects - 1. Every time halfTheObjects operations have completed, all ranges are shifted up by halfTheObjects. Example for one million objects: Deletes records from id 0000000 to id 0499999. Updates records from id 0500000 to id 0999999. Inserts records from id 1000000 to id 1499999. Every time 500000 operations have completed, all ranges are shifted up by 500000.


getResult

public String getResult()
Returns:
Example: "123.12 operations/second (12 threads)".

getOperationsPerSecond

public double getOperationsPerSecond()


Copyright © 2001-2013. All Rights Reserved.