Search in sources :

Example 1 with Value

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

the class MeanCoVData method printResult.

protected void printResult(final Result result, final File csvFile) throws IOException {
    try (BufferedWriter writer = new BufferedWriter(new FileWriter(csvFile))) {
        DescriptiveStatistics statistics = new DescriptiveStatistics();
        for (final Value value : result.getFulldata().getValue()) {
            statistics.addValue(value.getValue());
            if (statistics.getValues().length == avgCount) {
                final double cov = statistics.getVariance() / statistics.getMean();
                writer.write(statistics.getMean() + " " + cov + "\n");
                // writer.write(FORMAT.format(statistics.getMean()) + ";" + FORMAT.format(cov) + "\n");
                statistics = new DescriptiveStatistics();
            }
        }
        writer.flush();
        // System.out.println("set title 'Mean and Coefficient of Variation for " + clazzname + "." + testcase.getName() + "'");
        // System.out.println("set y2range [0:5]");
        // System.out.println("set y2tics");
        // System.out.println("set datafile separator ';'");
        // System.out.println("plot '" + csvFile.getName() + "' u ($0*" + AVG_COUNT + "):1 title 'Mean', '" + csvFile.getName() + "' u ($0*" + AVG_COUNT + "):2 title 'CoV' axes
        // x1y2");
        System.out.print(", '" + csvFile.getName() + "' u ($0*" + avgCount + "):1 title 'Mean'");
    // System.out.println();
    }
}
Also used : DescriptiveStatistics(org.apache.commons.math3.stat.descriptive.DescriptiveStatistics) FileWriter(java.io.FileWriter) Value(de.dagere.kopeme.generated.Result.Fulldata.Value) BufferedWriter(java.io.BufferedWriter)

Example 2 with Value

use of de.dagere.kopeme.generated.Result.Fulldata.Value 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 3 with Value

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

the class MavenTestExecutorMocker method buildFulldata.

private static void buildFulldata(final int average, final Result result) {
    final Fulldata values = new Fulldata();
    for (long i = average - 10; i <= average + 10; i++) {
        Value value = new Value();
        value.setStart(i);
        value.setValue(i);
        values.getValue().add(value);
    // values.put(i, i);
    }
    result.setFulldata(values);
}
Also used : Value(de.dagere.kopeme.generated.Result.Fulldata.Value) Fulldata(de.dagere.kopeme.generated.Result.Fulldata)

Example 4 with Value

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

the class MultipleVMTestUtil method createStatistics.

private static SummaryStatistics createStatistics(final Fulldata realData) {
    final SummaryStatistics st2 = new SummaryStatistics();
    final double[] values = new double[realData.getValue().size()];
    int i = 0;
    for (final Value value : realData.getValue()) {
        final long parseDouble = value.getValue();
        st2.addValue(parseDouble);
        values[i++] = parseDouble;
    }
    return st2;
}
Also used : Value(de.dagere.kopeme.generated.Result.Fulldata.Value) SummaryStatistics(org.apache.commons.math3.stat.descriptive.SummaryStatistics)

Example 5 with Value

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

the class DummyKoPeMeDataCreator method initDummyFulldata.

private static void initDummyFulldata(final Result result, final int count) {
    result.setFulldata(new Fulldata());
    final Value value = new Value();
    value.setValue(15);
    if (count > TestResult.BOUNDARY_SAVE_FILE) {
        try {
            ResultTempWriter writer = new ResultTempWriter(false);
            writeToDisk(count, writer);
            result.getFulldata().setFileName(writer.getTempFile().getAbsolutePath());
        } catch (IOException e) {
            e.printStackTrace();
        }
    } else {
        for (int i = 0; i < count; i++) {
            result.getFulldata().getValue().add(value);
        }
    }
}
Also used : ResultTempWriter(de.dagere.kopeme.datacollection.tempfile.ResultTempWriter) Value(de.dagere.kopeme.generated.Result.Fulldata.Value) IOException(java.io.IOException) Fulldata(de.dagere.kopeme.generated.Result.Fulldata)

Aggregations

Value (de.dagere.kopeme.generated.Result.Fulldata.Value)9 Fulldata (de.dagere.kopeme.generated.Result.Fulldata)4 Result (de.dagere.kopeme.generated.Result)3 DescriptiveStatistics (org.apache.commons.math3.stat.descriptive.DescriptiveStatistics)3 LinkedList (java.util.LinkedList)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ResultTempWriter (de.dagere.kopeme.datacollection.tempfile.ResultTempWriter)1 BufferedWriter (java.io.BufferedWriter)1 FileWriter (java.io.FileWriter)1 IOException (java.io.IOException)1 StatisticalSummary (org.apache.commons.math3.stat.descriptive.StatisticalSummary)1 StatisticalSummaryValues (org.apache.commons.math3.stat.descriptive.StatisticalSummaryValues)1 SummaryStatistics (org.apache.commons.math3.stat.descriptive.SummaryStatistics)1