public void writeResults()

in base/src/main/java/org/apache/sling/performance/ReportLogger.java [378:419]


    public void writeResults() throws Exception {
        PerformanceRecord referenceRecord = records.get(referenceMethod);
        for (String methodName : records.keySet()) {
            DescriptiveStatistics statistics = records.get(methodName).getStatistics();
            double min = statistics.getMin();
            double percentile10 = statistics.getPercentile(10);
            double percentile50 = statistics.getPercentile(50);
            double percentile90 = statistics.getPercentile(90);
            double max = statistics.getMax();
            boolean showDecimals = false;
            if (referenceRecord != null && !referenceMethod.equals(methodName)) {
                DescriptiveStatistics referenceStatistics = referenceRecord.getStatistics();
                double ref = referenceStatistics.getMin();
                min = ref == 0 ? Double.POSITIVE_INFINITY : min/ref;

                ref = referenceStatistics.getPercentile(10);
                percentile10 = ref == 0 ? Double.POSITIVE_INFINITY : percentile10/ref;

                ref = referenceStatistics.getPercentile(50);
                percentile50 = ref == 0 ? Double.POSITIVE_INFINITY : percentile50/ref;

                ref = referenceStatistics.getPercentile(90);
                percentile90 = ref == 0 ? Double.POSITIVE_INFINITY : percentile90/ref;

                ref = referenceStatistics.getMax();
                max = ref == 0 ? Double.POSITIVE_INFINITY : max /referenceStatistics.getMax();

                showDecimals = true;
            }
            ReportLogger.writeReportTxt(testSuiteName,
                    testCaseName,
                    Class.forName(className).getSimpleName(),
                    methodName,
                    min,
                    percentile10,
                    percentile50,
                    percentile90,
                    max,
                    PerformanceRunner.ReportLevel.MethodLevel,
                    showDecimals);
        }
    }