[Minor] Logging in PerformanceTestService.java

This commit is contained in:
Robert von Burg 2018-03-10 15:18:24 +01:00
parent 44bb21a43f
commit 9628e4af8a
2 changed files with 7 additions and 3 deletions

View File

@ -91,7 +91,8 @@ public class PerformanceTestService extends AbstractService<PerformanceTestArgum
long end = System.currentTimeMillis();
long took = end - start;
long txPerSec = allTx / (took / 1000);
logger.info("Took " + StringHelper.formatMillisecondsDuration(took) + " with " + txPerSec + " TXs/s");
logger.info("Took " + StringHelper.formatMillisecondsDuration(took) + " for " + allTx + " TXs with " + txPerSec
+ " TXs/s");
return new PerformanceTestResult(allTx);
}

View File

@ -60,6 +60,7 @@ public class PerformanceTransientTest extends PerformanceTest {
ForkJoinPool commonPool = ForkJoinPool.commonPool();
long start = System.currentTimeMillis();
List<ForkJoinTask<Long>> tasks = new ArrayList<>();
for (int i = 0; i < nrOfTasks; i++) {
PerformanceTask task = new PerformanceTask();
@ -75,11 +76,13 @@ public class PerformanceTransientTest extends PerformanceTest {
}
logger.info("Executed " + tasks.size() + " tasks.");
for (int i = 0; i < results.size(); i++) {
logger.info("Task " + i + " executed " + results.get(0) + " TXs");
logger.info("Task " + i + " executed " + results.get(i) + " TXs");
}
long avg = (long) results.stream().mapToLong(l -> l).average().getAsDouble();
logger.info("Average TXs was " + avg);
long took = System.currentTimeMillis() - start;
long txPerSec = avg / (took / 1000);
logger.info("Average TXs was " + avg + " with " + txPerSec + " TXs/s");
}
public class PerformanceTask extends ForkJoinTask<Long> {