private static void writeReportMethodLevel()

in base/src/main/java/org/apache/sling/performance/ReportLogger.java [280:316]


    private static void writeReportMethodLevel(String resultFileName, String testSuiteName,
                                               String testCaseName, String className, String methodName,
                                               double min, double percentile10, double percentile50, double percentile90, double max,
                                               boolean showDecimals) throws IOException {
        File report = getReportFile(resultFileName, ".txt");

        boolean needsPrefix = !report.exists();
        PrintWriter writer = new PrintWriter(
                new FileWriterWithEncoding(report, "UTF-8", true));
        try {
            if (needsPrefix) {
                writer.format(
                        "%-40.40s|%-120.120s|%-80.80s|%-40.40s|      DateTime      |  min  |   10%%   |   50%%   |   90%%   |   max%n",
                        "Test Suite",
                        "Test Case",
                        "Test Class",
                        "Test Method");
            }

            writer.format(
                    showDecimals ?
                            "%-40.40s|%-120.120s|%-80.80s|%-40.40s|%-20.20s|%7.2f|%9.2f|%9.2f|%9.2f|%9.2f%n":
                            "%-40.40s|%-120.120s|%-80.80s|%-40.40s|%-20.20s|%7.0f|%9.0f|%9.0f|%9.0f|%9.0f%n",
                    testSuiteName,
                    (testCaseName.length() < 120) ? (testCaseName) : (testCaseName.substring(0, 115) + "[...]"),
                    className,
                    methodName,
                    getDate(),
                    min,
                    percentile10,
                    percentile50,
                    percentile90,
                    max);
        } finally {
            writer.close();
        }
    }