Search in sources :

Example 1 with Chunk

use of de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk in project peass by DaGeRe.

the class MissingExecutionFinder method removeXMLExecutions.

private void removeXMLExecutions(final File folder) throws JAXBException {
    for (final File measurementFile : folder.listFiles()) {
        if (measurementFile.getName().endsWith(".xml")) {
            LOG.info("File:" + measurementFile);
            final Kopemedata data = new XMLDataLoader(measurementFile).getFullData();
            for (final TestcaseType testcase : data.getTestcases().getTestcase()) {
                final String testmethod = testcase.getName();
                for (final Chunk c : testcase.getDatacollector().get(0).getChunk()) {
                    final String version = findVersion(c);
                    LOG.debug("Removing {}", version);
                    final TestSet versionsTests = tests.getVersions().get(version);
                    if (versionsTests != null) {
                        removeTestFromTestSet(data.getTestcases().getClazz(), testmethod, versionsTests);
                    }
                }
            }
        }
    }
}
Also used : TestcaseType(de.dagere.kopeme.generated.TestcaseType) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) Kopemedata(de.dagere.kopeme.generated.Kopemedata) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk) File(java.io.File) TestSet(de.dagere.peass.dependency.analysis.data.TestSet)

Example 2 with Chunk

use of de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk 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 3 with Chunk

use of de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk in project peass by DaGeRe.

the class CopyFromFull method checkFileMerging.

public static void checkFileMerging(final File goal, final ExecutionData tests, final File source) throws JAXBException {
    Kopemedata kopemeData = XMLDataLoader.loadData(source);
    Testcases testcase = kopemeData.getTestcases();
    TestcaseType testcaseType = testcase.getTestcase().get(0);
    String clazz = testcase.getClazz();
    String method = testcaseType.getName();
    TestCase testcase2 = new TestCase(testcase);
    List<Chunk> chunks = testcaseType.getDatacollector().get(0).getChunk();
    if (!goal.exists()) {
        goal.mkdirs();
    }
    for (Chunk chunk : chunks) {
        checkChunkMerging(goal, tests, testcase2, chunk);
    }
}
Also used : TestCase(de.dagere.peass.dependency.analysis.data.TestCase) TestcaseType(de.dagere.kopeme.generated.TestcaseType) Testcases(de.dagere.kopeme.generated.Kopemedata.Testcases) Kopemedata(de.dagere.kopeme.generated.Kopemedata) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)

Example 4 with Chunk

use of de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk in project peass by DaGeRe.

the class TestDependencyTester method checkResult.

public static void checkResult(final PeassFolders folders) throws JAXBException {
    final File expectedSummaryResultFile = folders.getSummaryFile(EXAMPLE_TESTCASE);
    Assert.assertTrue(expectedSummaryResultFile.exists());
    final Kopemedata data = XMLDataLoader.loadData(expectedSummaryResultFile);
    final Datacollector collector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
    final Chunk chunk = collector.getChunk().get(0);
    Assert.assertEquals(105, chunk.getResult().get(0).getValue(), 0.1);
    Assert.assertEquals(5, chunk.getResult().get(0).getRepetitions());
    Assert.assertEquals(11, chunk.getResult().get(0).getIterations());
    Assert.assertEquals(10, chunk.getResult().get(0).getWarmup());
}
Also used : Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) Kopemedata(de.dagere.kopeme.generated.Kopemedata) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk) File(java.io.File)

Example 5 with Chunk

use of de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk in project peass by DaGeRe.

the class ResultLoader method loadData.

public void loadData(PeassFolders folders, final TestCase testcase, final long currentChunkStart) throws JAXBException {
    final File kopemeFile = folders.getSummaryFile(testcase);
    final XMLDataLoader loader = new XMLDataLoader(kopemeFile);
    if (loader.getFullData().getTestcases().getTestcase().size() > 0) {
        final Datacollector dataCollector = loader.getFullData().getTestcases().getTestcase().get(0).getDatacollector().get(0);
        final Chunk realChunk = MultipleVMTestUtil.findChunk(currentChunkStart, dataCollector);
        loadChunk(realChunk);
    }
}
Also used : Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) Chunk(de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk) File(java.io.File)

Aggregations

Chunk (de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)15 Kopemedata (de.dagere.kopeme.generated.Kopemedata)8 File (java.io.File)8 Datacollector (de.dagere.kopeme.generated.TestcaseType.Datacollector)5 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)5 XMLDataLoader (de.dagere.kopeme.datastorage.XMLDataLoader)4 TestcaseType (de.dagere.kopeme.generated.TestcaseType)4 Result (de.dagere.kopeme.generated.Result)3 DescribedChunk (de.dagere.peass.measurement.statistics.data.DescribedChunk)2 WildcardFileFilter (org.apache.commons.io.filefilter.WildcardFileFilter)2 Testcases (de.dagere.kopeme.generated.Kopemedata.Testcases)1 Fulldata (de.dagere.kopeme.generated.Result.Fulldata)1 Versioninfo (de.dagere.kopeme.generated.Versioninfo)1 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)1 TestSet (de.dagere.peass.dependency.analysis.data.TestSet)1 PeassFolders (de.dagere.peass.folders.PeassFolders)1 MeasurementFileFinder (de.dagere.peass.measurement.dataloading.MeasurementFileFinder)1 FilenameFilter (java.io.FilenameFilter)1 HashMap (java.util.HashMap)1 LinkedHashSet (java.util.LinkedHashSet)1