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)));
}
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)));
}
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());
}
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());
}
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());
}
Aggregations