Search in sources :

Example 1 with Result

use of de.dagere.kopeme.generated.Result in project peass by DaGeRe.

the class ChangeReader method writeRunCommands.

private void writeRunCommands(final String[] versions, final DescribedChunk describedChunk, final TestCase testcase) {
    if (runCommandWriter != null) {
        final Result exampleResult = describedChunk.getCurrent().get(0);
        final int iterations = (int) exampleResult.getIterations();
        final int repetitions = (int) exampleResult.getRepetitions();
        final int vms = describedChunk.getCurrent().size();
        final int versionIndex = Arrays.binarySearch(dependencies.getVersionNames(), versions[1]);
        runCommandWriter.createSingleMethodCommand(versionIndex, versions[1], testcase.getExecutable(), (int) exampleResult.getWarmup(), iterations, repetitions, vms);
        runCommandWriterSlurm.createSingleMethodCommand(versionIndex, versions[1], testcase.getExecutable(), iterations, repetitions, vms);
    }
}
Also used : Result(de.dagere.kopeme.generated.Result)

Example 2 with Result

use of de.dagere.kopeme.generated.Result in project peass by DaGeRe.

the class MeanCoVData method printTestcaseData.

public void printTestcaseData(final File folder) throws IOException {
    for (final Result result : results) {
        final File csvFile = new File(folder, "result_" + testMethodName + "_" + result.getDate() + ".csv");
        printResult(result, csvFile);
    }
    System.out.println();
}
Also used : File(java.io.File) Result(de.dagere.kopeme.generated.Result)

Example 3 with Result

use of de.dagere.kopeme.generated.Result in project peass by DaGeRe.

the class IsThereTimeReductionIterations method getMeasurements.

private List<double[]> getMeasurements(final List<Result> previusValues) {
    final List<double[]> beforeMeasurements = new LinkedList<>();
    for (final Result result : previusValues) {
        final double[] vals = new double[result.getFulldata().getValue().size()];
        int index = 0;
        for (final Value value : result.getFulldata().getValue()) {
            vals[index] = value.getValue();
            index++;
        }
        beforeMeasurements.add(vals);
    }
    return beforeMeasurements;
}
Also used : Value(de.dagere.kopeme.generated.Result.Fulldata.Value) LinkedList(java.util.LinkedList) Result(de.dagere.kopeme.generated.Result)

Example 4 with Result

use of de.dagere.kopeme.generated.Result in project peass by DaGeRe.

the class IsThereTimeReductionVM method checkFolder.

private static void checkFolder(final File contentFolder) throws JAXBException {
    for (final File xmlFile : contentFolder.listFiles()) {
        if (xmlFile.getName().endsWith(".xml")) {
            final XMLDataLoader loader = new XMLDataLoader(xmlFile);
            final Set<String> versions = new LinkedHashSet<>();
            for (Chunk chunk : loader.getFullData().getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk()) {
                final Map<String, List<Result>> data = new HashMap<>();
                String version = chunk.getResult().get(1).getVersion().getGitversion();
                String versionOld = chunk.getResult().get(0).getVersion().getGitversion();
                for (Result r : chunk.getResult()) {
                    List<Result> current = data.get(r.getVersion().getGitversion());
                    if (current == null) {
                        current = new LinkedList<>();
                        data.put(r.getVersion().getGitversion(), current);
                    }
                    current.add(r);
                    vms++;
                }
                testSpeedup(xmlFile, data, versionOld, version);
            }
        }
    }
}
Also used : LinkedHashSet(java.util.LinkedHashSet) HashMap(java.util.HashMap) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) List(java.util.List) LinkedList(java.util.LinkedList) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk) File(java.io.File) Result(de.dagere.kopeme.generated.Result)

Example 5 with Result

use of de.dagere.kopeme.generated.Result in project peass by DaGeRe.

the class TestResultOrganizerParams method testReading.

@Test
public void testReading() throws JAXBException, IOException {
    TestCase testcase = new TestCase("de.dagere.peass.ExampleBenchmarkClazz#calleeMethod");
    PeassFolders folders = mockFolders(testcase);
    for (int i = 0; i < 3; i++) {
        ResultOrganizer organizer = new ResultOrganizer(folders, VERSION, 15 + i, false, false, testcase, 10);
        organizer.saveResultFiles(VERSION, i);
        organizer.saveResultFiles(VERSION_OLD, i);
    }
    File expectedResultFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1).xml");
    File expectedResultFile2 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2).xml");
    Assert.assertTrue(expectedResultFile1.exists());
    Assert.assertTrue(expectedResultFile2.exists());
    Kopemedata data = XMLDataLoader.loadData(expectedResultFile1);
    List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getChunk().get(0).getResult();
    MatcherAssert.assertThat(results, IsIterableWithSize.iterableWithSize(2));
    File expectedFulldataFile = new File(TEMP_FULL_DIR, "calleeMethod(parameter-2)_0_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
    Kopemedata fulldata = XMLDataLoader.loadData(expectedFulldataFile);
    Assert.assertEquals(1, fulldata.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
    File expectedFulldataFile1 = new File(TEMP_FULL_DIR, "calleeMethod(parameter-1)_2_d77cb2ff2a446c65f0a63fd0359f9ba4dbfdb9d9.xml");
    Kopemedata fulldata1 = XMLDataLoader.loadData(expectedFulldataFile1);
    Assert.assertEquals(1, fulldata1.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult().size());
}
Also used : ResultOrganizer(de.dagere.peass.measurement.organize.ResultOrganizer) TestCase(de.dagere.peass.dependency.analysis.data.TestCase) Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) PeassFolders(de.dagere.peass.folders.PeassFolders) Result(de.dagere.kopeme.generated.Result) Test(org.junit.jupiter.api.Test)

Aggregations

Result (de.dagere.kopeme.generated.Result)63 File (java.io.File)17 Kopemedata (de.dagere.kopeme.generated.Kopemedata)15 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)8 Test (org.junit.jupiter.api.Test)8 DescriptiveStatistics (org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)6 XMLDataLoader (de.dagere.kopeme.datastorage.XMLDataLoader)5 Fulldata (de.dagere.kopeme.generated.Result.Fulldata)5 TestcaseType (de.dagere.kopeme.generated.TestcaseType)5 Datacollector (de.dagere.kopeme.generated.TestcaseType.Datacollector)5 IOException (java.io.IOException)5 Test (org.junit.Test)5 BimodalityTester (de.dagere.peass.measurement.statistics.bimodal.BimodalityTester)4 CompareData (de.dagere.peass.measurement.statistics.bimodal.CompareData)4 LinkedList (java.util.LinkedList)4 Value (de.dagere.kopeme.generated.Result.Fulldata.Value)3 Chunk (de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)3 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)3 PeassFolders (de.dagere.peass.folders.PeassFolders)3 List (java.util.List)3