Search in sources :

Example 11 with Result

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

the class DependencyTester method updateExecutions.

boolean updateExecutions(final TestCase testcase, final int vmid) throws JAXBException {
    boolean shouldBreak = false;
    final Result versionOldResult = getLastResult(configuration.getExecutionConfig().getVersionOld(), testcase, vmid);
    final Result versionNewResult = getLastResult(configuration.getExecutionConfig().getVersion(), testcase, vmid);
    if (vmid < 40) {
        int reducedIterations = Math.min(shouldReduce(configuration.getExecutionConfig().getVersionOld(), versionOldResult), shouldReduce(configuration.getExecutionConfig().getVersion(), versionNewResult));
        if (reducedIterations != configuration.getIterations()) {
            LOG.error("Should originally run {} iterations, but did not succeed - reducing to {}", configuration.getIterations(), reducedIterations);
            // final int lessIterations = testTransformer.getConfig().getIterations() / 5;
            shouldBreak = reduceExecutions(shouldBreak, reducedIterations);
        }
    }
    return shouldBreak;
}
Also used : Result(de.dagere.kopeme.generated.Result)

Example 12 with Result

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

the class MeasurementAnalysationUtil method getAveragesArrayFromResults.

public static double[] getAveragesArrayFromResults(final List<Result> results) {
    final double[] values = new double[results.size()];
    int i = 0;
    for (final Result result : results) {
        final double value = result.getValue();
        values[i++] = value;
    }
    return values;
}
Also used : Result(de.dagere.kopeme.generated.Result)

Example 13 with Result

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

the class MeasurementAnalysationUtil method analyzeKopemeData.

public static List<PerformanceChange> analyzeKopemeData(final Kopemedata data) {
    final Map<String, List<Result>> results = new LinkedHashMap<>();
    int maxResultSize = 0;
    final TestcaseType currentTestcase = data.getTestcases().getTestcase().get(0);
    final String clazz = data.getTestcases().getClazz();
    final String method = currentTestcase.getName();
    final List<Datacollector> datacollectors = currentTestcase.getDatacollector();
    if (datacollectors.size() != 1) {
        LOG.warn("Mehr als ein DataCollector bei: {}", method);
    }
    for (final Result result : datacollectors.get(0).getResult()) {
        final String gitversion = result.getVersion().getGitversion();
        if (!results.containsKey(gitversion)) {
            results.put(gitversion, new LinkedList<>());
        }
        results.get(gitversion).add(result);
        if (results.get(gitversion).size() > maxResultSize) {
            maxResultSize = results.get(gitversion).size();
        }
    }
    ConfidenceInterval previous = null;
    String previousVersion = null;
    final List<PerformanceChange> changes = new LinkedList<>();
    final ExecutorService service = Executors.newFixedThreadPool(4);
    for (final Map.Entry<String, List<Result>> entry : results.entrySet()) {
        final double[] values = getAveragesArrayFromResults(entry.getValue());
        final ConfidenceInterval interval = getBootstrapConfidenceInterval(values, 20, 1000, 96);
        LOG.trace("{}-Konfidenzintervall: {} - {}", interval.getPercentage(), interval.getMin(), interval.getMax());
        if (previous != null) {
            final ConfidenceInterval previousConfidenceInterval = previous;
            final String previousVersion2 = previousVersion;
            LOG.trace("Start " + previousVersion2);
            service.execute(new Runnable() {

                @Override
                public void run() {
                    final String currentVersion = entry.getValue().get(0).getVersion().getGitversion();
                    final PerformanceChange change = new PerformanceChange(previousConfidenceInterval, interval, clazz, method, previousVersion2, currentVersion);
                    final boolean isChange = analysePotentialChange(change, previousConfidenceInterval, entry, interval);
                    if (isChange) {
                        changes.add(change);
                    }
                }
            });
        }
        previous = interval;
        previousVersion = entry.getKey();
    }
    try {
        service.shutdown();
        service.awaitTermination(1, TimeUnit.DAYS);
    } catch (final InterruptedException e) {
        e.printStackTrace();
    }
    return changes;
}
Also used : LinkedList(java.util.LinkedList) LinkedHashMap(java.util.LinkedHashMap) Result(de.dagere.kopeme.generated.Result) Datacollector(de.dagere.kopeme.generated.TestcaseType.Datacollector) TestcaseType(de.dagere.kopeme.generated.TestcaseType) ExecutorService(java.util.concurrent.ExecutorService) LinkedList(java.util.LinkedList) List(java.util.List) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map)

Example 14 with Result

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

the class DummyKoPeMeDataCreator method initDummyTestfile.

public static void initDummyTestfile(final File methodFolder, final int iterations, final TestCase testcase) throws JAXBException {
    XMLDataStorer storer = new XMLDataStorer(methodFolder, testcase.getClazz(), testcase.getMethod());
    final Result result = new Result();
    result.setValue(15);
    result.setIterations(iterations);
    initDummyFulldata(result, iterations);
    storer.storeValue(result, testcase.getExecutable(), TimeDataCollector.class.getName());
}
Also used : TimeDataCollector(de.dagere.kopeme.datacollection.TimeDataCollector) XMLDataStorer(de.dagere.kopeme.datastorage.XMLDataStorer) TestResult(de.dagere.kopeme.datacollection.TestResult) Result(de.dagere.kopeme.generated.Result)

Example 15 with Result

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

the class OutlierRemover method removeByValue.

private void removeByValue(DescriptiveStatistics statistics, List<Result> results, double value) {
    for (Iterator<Result> it = results.iterator(); it.hasNext(); ) {
        Result result = it.next();
        if (result.getValue() == value) {
            LOG.debug("Removing Value: {}", result.getValue());
            it.remove();
            break;
        }
    }
    rebuildStatistics(statistics, results);
}
Also used : Result(de.dagere.kopeme.generated.Result)

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