use of de.dagere.peass.measurement.statistics.data.TestData in project peass by DaGeRe.
the class FindLowestPossibleIterations method call.
@Override
public Void call() throws InterruptedException, StreamReadException, DatabindException, IOException {
final StaticTestSelection dependencies = Constants.OBJECTMAPPER.readValue(dependencyFile, StaticTestSelection.class);
VersionComparator.setDependencies(dependencies);
for (File fullDataFolder : data) {
LOG.info("Loading: {}", fullDataFolder);
if (!fullDataFolder.exists()) {
LOG.error("Ordner existiert nicht!");
System.exit(1);
}
final LinkedBlockingQueue<TestData> measurements = new LinkedBlockingQueue<>();
DataReader.startReadVersionDataMap(fullDataFolder, measurements);
TestData measurementEntry = measurements.take();
while (measurementEntry != DataReader.POISON_PILL) {
processTestdata(measurementEntry);
measurementEntry = measurements.take();
}
}
LOG.debug("Final minimal VM executions for same result: " + vmDeterminer.getMinNeccessaryValue() + " Average: " + ((double) vmDeterminer.getSum() / vmDeterminer.getCount()));
LOG.debug(vmDeterminer.getValues());
return null;
// LOG.debug("Final minimal measurement executions for same result: " + exDeterminer.minNeccessaryValue + " Average: " + ((double) exDeterminer.sum / exDeterminer.count));
// LOG.debug(exDeterminer.values);
}
use of de.dagere.peass.measurement.statistics.data.TestData in project peass by DaGeRe.
the class IsThereTimeReductionIterations method analyze.
public void analyze(final File[] data) throws InterruptedException {
for (File folder : data) {
for (final File slaveFolder : folder.listFiles()) {
final File fullDataFolder = new File(slaveFolder, "measurementsFull/measurements/");
final LinkedBlockingQueue<TestData> measurements = new LinkedBlockingQueue<>();
DataReader.startReadVersionDataMap(fullDataFolder, measurements);
TestData measurementEntry = measurements.take();
while (measurementEntry != DataReader.POISON_PILL) {
try {
System.out.println("Analyze: " + measurementEntry.getTestClass());
processTestdata(measurementEntry);
} catch (final RuntimeException e) {
}
measurementEntry = measurements.take();
}
}
}
System.out.println("Additional: " + additionalFound + " Wrong: " + lessfound + " Speedup:" + speedup + " Tests: " + count);
System.out.println("Average Iterations: " + avgcount / vms);
}
use of de.dagere.peass.measurement.statistics.data.TestData in project peass by DaGeRe.
the class DataReader method readDataToQueue.
private static void readDataToQueue(final File fullDataFolder, final LinkedBlockingQueue<TestData> measurements) {
LOG.info("Loading folder: {}", fullDataFolder);
for (final File clazzFile : fullDataFolder.listFiles()) {
final Map<String, TestData> currentMeasurement = readClassFolder(clazzFile);
for (final TestData data : currentMeasurement.values()) {
LOG.debug("Add: {}", data.getTestClass() + " " + data.getTestMethod());
while (measurements.size() > MAX_QUEUE_SIZE) {
LOG.info("Waiting, Measurements: {} Max-Queue-Size: {}", measurements.size(), MAX_QUEUE_SIZE);
try {
Thread.sleep(1000);
} catch (final InterruptedException e) {
e.printStackTrace();
}
}
measurements.add(data);
size += data.getVersions();
}
}
}
use of de.dagere.peass.measurement.statistics.data.TestData in project peass by DaGeRe.
the class DataReader method readMeasurementFile.
private static void readMeasurementFile(final Map<String, TestData> currentMeasurement, final File versionOfPair, final File versionCurrent, final File measurementFile) {
try {
final Kopemedata resultData = new XMLDataLoader(measurementFile).getFullData();
final String testclazz = resultData.getTestcases().getClazz();
TestCase testcase = new TestCase(resultData.getTestcases());
TestData testData = currentMeasurement.get(testcase.getMethodWithParams());
if (testData == null) {
final File originFile = measurementFile.getParentFile().getParentFile().getParentFile().getParentFile().getParentFile().getParentFile().getParentFile();
testData = new TestData(testcase, originFile);
currentMeasurement.put(testcase.getMethodWithParams(), testData);
}
String predecessor = null;
final File[] versionFiles = versionOfPair.listFiles();
for (final File version : versionFiles) {
if (!version.getName().equals(versionOfPair.getName())) {
predecessor = version.getName();
}
}
if (predecessor != null) {
testData.addMeasurement(versionOfPair.getName(), versionCurrent.getName(), predecessor, resultData);
} else {
LOG.error("No predecessor data for {} {} {} {}", versionCurrent.getName(), predecessor, testclazz, testcase.getMethodWithParams());
}
} catch (final JAXBException e) {
LOG.error("An exception occured during reading the measurement results");
e.printStackTrace();
}
}
use of de.dagere.peass.measurement.statistics.data.TestData in project peass by DaGeRe.
the class DependencyTester method postEvaluate.
public void postEvaluate() {
if (currentOrganizer != null) {
final File cleanFolder = folders.getNativeCleanFolder();
if (!cleanFolder.exists()) {
cleanFolder.mkdirs();
}
final Cleaner cleaner = new Cleaner(cleanFolder);
for (final File clazzFile : folders.getDetailResultFolder().listFiles()) {
final Map<String, TestData> testdata = DataReader.readClassFolder(clazzFile);
for (final Map.Entry<String, TestData> entry : testdata.entrySet()) {
cleaner.processTestdata(entry.getValue());
}
}
}
}
Aggregations