Search in sources :

Example 6 with Measurement

use of io.narayana.perf.Measurement in project narayana by jbosstm.

the class OnePhasePerformanceDefaultUnitTest method test.

@Test
public void test() {
    int warmUpCount = 0;
    int numberOfThreads = 10;
    int batchSize = 1000;
    int numberOfTransactions = numberOfThreads * batchSize;
    Measurement measurement = new Measurement.Builder(getClass().getName() + "_test1").maxTestTime(0L).numberOfCalls(numberOfTransactions).numberOfThreads(numberOfThreads).batchSize(batchSize).numberOfWarmupCalls(warmUpCount).build().measure(worker, worker);
    System.out.printf("%s%n", measurement.getInfo());
    Assert.assertEquals(0, measurement.getNumberOfErrors());
    Assert.assertFalse(measurement.getInfo(), measurement.shouldFail());
    long timeTaken = measurement.getTotalMillis();
    System.out.println("ObjectStore used: " + arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreType());
    System.out.println("time for " + numberOfTransactions + " write transactions is " + timeTaken);
    System.out.println("number of transactions: " + numberOfTransactions);
    System.out.println("throughput: " + (float) (numberOfTransactions / (timeTaken / 1000.0)));
}
Also used : Measurement(io.narayana.perf.Measurement) Test(org.junit.Test)

Example 7 with Measurement

use of io.narayana.perf.Measurement in project narayana by jbosstm.

the class OnePhasePerformanceVolatileUnitTest method test.

@Test
public void test() {
    int warmUpCount = 0;
    int numberOfThreads = 10;
    int batchSize = 1000;
    int numberOfTransactions = numberOfThreads * batchSize;
    Measurement measurement = new Measurement.Builder(getClass().getName() + "_test1").maxTestTime(0L).numberOfCalls(numberOfTransactions).numberOfThreads(numberOfThreads).batchSize(batchSize).numberOfWarmupCalls(warmUpCount).build().measure(worker, worker);
    System.out.printf("%s%n", measurement.getInfo());
    Assert.assertEquals(0, measurement.getNumberOfErrors());
    Assert.assertFalse(measurement.getInfo(), measurement.shouldFail());
    long timeTaken = measurement.getTotalMillis();
    System.out.println("ObjectStore used: " + arjPropertyManager.getObjectStoreEnvironmentBean().getObjectStoreType());
    System.out.println("time for " + numberOfTransactions + " write transactions is " + timeTaken);
    System.out.println("number of transactions: " + numberOfTransactions);
    System.out.println("throughput: " + (float) (numberOfTransactions / (timeTaken / 1000.0)));
}
Also used : Measurement(io.narayana.perf.Measurement) Test(org.junit.Test)

Example 8 with Measurement

use of io.narayana.perf.Measurement in project narayana by jbosstm.

the class Performance3 method test.

@Test
public void test() {
    int warmUpCount = 10;
    int numberOfTransactions = 1000000;
    int threadCount = 1;
    int batchSize = 100;
    Measurement measurement = new Measurement.Builder(getClass().getName() + "_test1").maxTestTime(0L).numberOfCalls(numberOfTransactions).numberOfThreads(threadCount).batchSize(batchSize).numberOfWarmupCalls(warmUpCount).build().measure(worker);
    Assert.assertEquals(0, measurement.getNumberOfErrors());
    Assert.assertFalse(measurement.getInfo(), measurement.shouldFail());
    System.out.printf("%s%n", measurement.getInfo());
    System.err.println("TPS: " + measurement.getThroughput());
}
Also used : Measurement(io.narayana.perf.Measurement) Test(org.junit.Test)

Example 9 with Measurement

use of io.narayana.perf.Measurement in project narayana by jbosstm.

the class Performance1 method test.

@Test
public void test() {
    int warmUpCount = 10;
    int numberOfTransactions = 1000000;
    int threadCount = 1;
    int batchSize = 100;
    Measurement measurement = new Measurement.Builder(getClass().getName() + "_test1").maxTestTime(0L).numberOfCalls(numberOfTransactions).numberOfThreads(threadCount).batchSize(batchSize).numberOfWarmupCalls(warmUpCount).build().measure(worker);
    Assert.assertEquals(0, measurement.getNumberOfErrors());
    Assert.assertFalse(measurement.getInfo(), measurement.shouldFail());
    System.out.printf("%s%n", measurement.getInfo());
    System.out.println("time for " + numberOfTransactions + " write transactions is " + measurement.getTotalMillis());
    System.out.println("number of transactions: " + numberOfTransactions);
    System.out.println("throughput: " + measurement.getThroughput());
}
Also used : Measurement(io.narayana.perf.Measurement) Test(org.junit.Test)

Example 10 with Measurement

use of io.narayana.perf.Measurement in project narayana by jbosstm.

the class Performance2 method test.

@Test
public void test() {
    int numberOfTransactions = 1000;
    int threads = 10;
    int work = 100;
    int warmUpCount = 0;
    arjPropertyManager.getCoordinatorEnvironmentBean().setCommitOnePhase(false);
    Measurement measurement = new Measurement.Builder(getClass().getName() + "_test1").maxTestTime(0L).numberOfCalls(numberOfTransactions).numberOfThreads(threads).batchSize(work).numberOfWarmupCalls(warmUpCount).build().measure(worker);
    Assert.assertEquals(0, measurement.getNumberOfErrors());
    Assert.assertFalse(measurement.getInfo(), measurement.shouldFail());
    System.out.printf("%s%n", measurement.getInfo());
    System.out.println("time for " + numberOfTransactions + " write transactions is " + measurement.getTotalMillis());
    System.out.println("number of transactions: " + numberOfTransactions);
    System.out.println("throughput: " + measurement.getThroughput());
}
Also used : Measurement(io.narayana.perf.Measurement) Test(org.junit.Test)

Aggregations

Measurement (io.narayana.perf.Measurement)12 Test (org.junit.Test)10 TwoPhaseVolatileStore (com.arjuna.ats.internal.arjuna.objectstore.TwoPhaseVolatileStore)1 ORB (com.arjuna.orbportability.ORB)1 RootOA (com.arjuna.orbportability.RootOA)1 ServerORB (com.hp.mwtests.ts.jts.utils.ServerORB)1 Worker (io.narayana.perf.Worker)1 SQLException (java.sql.SQLException)1 Date (java.util.Date)1 HeuristicMixedException (javax.transaction.HeuristicMixedException)1 HeuristicRollbackException (javax.transaction.HeuristicRollbackException)1 NotSupportedException (javax.transaction.NotSupportedException)1 RollbackException (javax.transaction.RollbackException)1 SystemException (javax.transaction.SystemException)1