Search in sources :

Example 26 with Kopemedata

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

the class TestResultConversion method testDefaultConversion.

@Test
public void testDefaultConversion() throws JAXBException {
    File jmhFile = new File(CONVERSION_FOLDER, "testMethod.json");
    Set<File> resultFiles = convert(jmhFile);
    MatcherAssert.assertThat(resultFiles, Matchers.hasSize(1));
    File resultFile = resultFiles.iterator().next();
    Kopemedata data = XMLDataLoader.loadData(resultFile);
    List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult();
    MatcherAssert.assertThat(results, Matchers.hasSize(1));
    Result result = results.get(0);
    Assert.assertEquals(result.getValue(), 1101075.0, 0.01);
    Assert.assertEquals(result.getFulldata().getValue().get(0).getValue(), 1101075);
}
Also used : Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) Result(de.dagere.kopeme.generated.Result) Test(org.junit.jupiter.api.Test)

Example 27 with Kopemedata

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

the class TestResultConversion method testThroughputConversion.

@Test
public void testThroughputConversion() throws JAXBException {
    File jmhFile = new File(CONVERSION_FOLDER, "testMethod_throughput.json");
    Set<File> resultFiles = convert(jmhFile);
    MatcherAssert.assertThat(resultFiles, Matchers.hasSize(1));
    File resultFile = resultFiles.iterator().next();
    Kopemedata data = XMLDataLoader.loadData(resultFile);
    List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult();
    MatcherAssert.assertThat(results, Matchers.hasSize(5));
    Result result = results.get(0);
    Assert.assertEquals(result.getValue(), 1064297.5, 0.01);
    Assert.assertEquals(result.getFulldata().getValue().get(0).getValue(), 1063790.0, 0.01);
}
Also used : Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) Result(de.dagere.kopeme.generated.Result) Test(org.junit.jupiter.api.Test)

Example 28 with Kopemedata

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

the class TestResultConversion method testOriginalJmhConversionParams.

@Test
public void testOriginalJmhConversionParams() throws JAXBException {
    File jmhFile = new File(CONVERSION_FOLDER, "example-with-params.json");
    Set<File> resultFiles = convert(jmhFile);
    MatcherAssert.assertThat(resultFiles, Matchers.hasSize(1));
    File resultFile = resultFiles.iterator().next();
    Kopemedata data = XMLDataLoader.loadData(resultFile);
    List<Result> results = data.getTestcases().getTestcase().get(0).getDatacollector().get(0).getResult();
    MatcherAssert.assertThat(results, Matchers.hasSize(3));
    Result result = results.get(0);
    Assert.assertEquals(result.getParams().getParam().get(0).getKey(), "TEST_PARAM");
    Assert.assertEquals(result.getParams().getParam().get(0).getValue(), "val1");
}
Also used : Kopemedata(de.dagere.kopeme.generated.Kopemedata) File(java.io.File) Result(de.dagere.kopeme.generated.Result) Test(org.junit.jupiter.api.Test)

Example 29 with Kopemedata

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

the class ExternalJmhDataConverter method createChunks.

private static void createChunks(final Set<File> resultFiles, final String currentVersion) throws JAXBException {
    for (File resultFile : resultFiles) {
        LOG.info("Handling " + resultFile);
        Kopemedata data = XMLDataLoader.loadData(resultFile);
        Datacollector datacollector = data.getTestcases().getTestcase().get(0).getDatacollector().get(0);
        Set<String> allParams = getParams(datacollector);
        for (String params : allParams) {
            Chunk addedChunk = new Chunk();
            datacollector.getResult().forEach(result -> {
                if (params != null && ParamNameHelper.paramsToString(result.getParams()).equals(params)) {
                    addedChunk.getResult().add(result);
                    result.setVersion(new Versioninfo());
                    result.getVersion().setGitversion(currentVersion);
                }
            });
            datacollector.getChunk().add(addedChunk);
        }
        datacollector.getResult().clear();
        XMLDataStorer.storeData(resultFile, data);
    }
}
Also used : Versioninfo(de.dagere.kopeme.generated.Versioninfo) 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 30 with Kopemedata

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

the class MeasurementFileFinder method loadData.

public Kopemedata loadData(final File file) throws JAXBException {
    final XMLDataLoader xdl2 = new XMLDataLoader(file);
    final Kopemedata oneResultData2 = xdl2.getFullData();
    return oneResultData2;
}
Also used : XMLDataLoader(de.dagere.kopeme.datastorage.XMLDataLoader) Kopemedata(de.dagere.kopeme.generated.Kopemedata)

Aggregations

Kopemedata (de.dagere.kopeme.generated.Kopemedata)38 File (java.io.File)29 Result (de.dagere.kopeme.generated.Result)15 XMLDataLoader (de.dagere.kopeme.datastorage.XMLDataLoader)14 TestcaseType (de.dagere.kopeme.generated.TestcaseType)14 Test (org.junit.jupiter.api.Test)12 TestCase (de.dagere.peass.dependency.analysis.data.TestCase)11 Datacollector (de.dagere.kopeme.generated.TestcaseType.Datacollector)10 Chunk (de.dagere.kopeme.generated.TestcaseType.Datacollector.Chunk)8 JAXBException (javax.xml.bind.JAXBException)6 Fulldata (de.dagere.kopeme.generated.Result.Fulldata)4 PeassFolders (de.dagere.peass.folders.PeassFolders)4 MeasurementConfig (de.dagere.peass.config.MeasurementConfig)3 WildcardFileFilter (org.apache.commons.io.filefilter.WildcardFileFilter)3 DescriptiveStatistics (org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)3 TimeDataCollector (de.dagere.kopeme.datacollection.TimeDataCollector)2 Testcases (de.dagere.kopeme.generated.Kopemedata.Testcases)2 JmhTestTransformer (de.dagere.peass.dependency.jmh.JmhTestTransformer)2 EnvironmentVariables (de.dagere.peass.execution.utils.EnvironmentVariables)2 TestExecutor (de.dagere.peass.execution.utils.TestExecutor)2