PreparedStatement operationsForExecution = connection.prepareStatement("select version, executionTimeMs, heapUsageBytes, totalHeapUsageBytes, maxHeapUsageBytes, maxUncollectedHeapBytes, maxCommittedHeapBytes from testOperation where testExecution = ?");
executionsForName.setString(1, testName);
ResultSet testExecutions = executionsForName.executeQuery();
while (testExecutions.next()) {
long id = testExecutions.getLong(1);
PerformanceResults performanceResults = new PerformanceResults();
performanceResults.setTestId(testName);
performanceResults.setTestTime(testExecutions.getTimestamp(2).getTime());
performanceResults.setVersionUnderTest(testExecutions.getString(3));
performanceResults.setTestProject(testExecutions.getString(4));
performanceResults.setTasks(toArray(testExecutions.getObject(5)));
performanceResults.setArgs(toArray(testExecutions.getObject(6)));
performanceResults.setOperatingSystem(testExecutions.getString(7));
performanceResults.setJvm(testExecutions.getString(8));
performanceResults.setVcsBranch(testExecutions.getString(9).trim());
performanceResults.setVcsCommit(testExecutions.getString(10));
results.add(performanceResults);
allBranches.add(performanceResults.getVcsBranch());
operationsForExecution.setLong(1, id);
ResultSet builds = operationsForExecution.executeQuery();
while (builds.next()) {
String version = builds.getString(1);
if ("1.7".equals(version) && performanceResults.getTestTime() <= ignoreV17Before) {
// Ignore some broken samples
continue;
}
MeasuredOperation operation = new MeasuredOperation();
operation.setExecutionTime(Duration.millis(builds.getBigDecimal(2)));
operation.setTotalMemoryUsed(DataAmount.bytes(builds.getBigDecimal(3)));
operation.setTotalHeapUsage(DataAmount.bytes(builds.getBigDecimal(4)));
operation.setMaxHeapUsage(DataAmount.bytes(builds.getBigDecimal(5)));
operation.setMaxUncollectedHeap(DataAmount.bytes(builds.getBigDecimal(6)));
operation.setMaxCommittedHeap(DataAmount.bytes(builds.getBigDecimal(7)));
if (version == null) {
performanceResults.getCurrent().add(operation);
} else {
BaselineVersion baselineVersion = performanceResults.baseline(version);
baselineVersion.getResults().add(operation);
allVersions.add(version);
}
}
}