org.apache.sling.performance

## Class ReportLogger

- java.lang.Object
- - org.apache.sling.performance.ReportLogger

    public class ReportLogger
    extends Object

### Nested Class Summary

Nested Classes
`static class` `ReportLogger.ReportType`

### Field Summary

Fields
`static String` `REPORTS_DIR`

### Method Summary

Methods
`static List<org.junit.runner.notification.Failure>` `checkAllThresholds()` Check all thresholds for all records in all registered loggers
`List<org.junit.runner.notification.Failure>` `checkThresholds()` Test if any of the PerformanceRecord exceeds their threshold against the reference
`static ReportLogger` `getOrCreate(String testSuiteName, String testCaseName, String className, String referenceMethod)` Factory method for ReportRecorder.
`void` `recordStatistics(String methodName, org.apache.commons.math.stat.descriptive.DescriptiveStatistics statistics, double threshold)` Record statistics for given method
`static void` `writeAllResults()` Write results from all registered loggers
`static void` `writeReport(String testSuiteName, String testCaseName, String className, String methodName, org.apache.commons.math.stat.descriptive.DescriptiveStatistics statistics, ReportLogger.ReportType reportType, PerformanceRunner.ReportLevel reportLevel)` Method the writes the performance report after a test is run
`static void` `writeReportTxt(String testSuiteName, String testCaseName, String className, String methodName, org.apache.commons.math.stat.descriptive.DescriptiveStatistics statistics, PerformanceRunner.ReportLevel reportLevel)` Method the writes the performance report after a test is run, in text format
`static void` `writeReportTxt(String testSuiteName, String testCaseName, String className, String methodName, double min, double percentile10, double percentile50, double percentile90, double max, PerformanceRunner.ReportLevel reportLevel)` Method that writes the performance report
`static void` `writeReportTxt(String testSuiteName, String testCaseName, String className, String methodName, double min, double percentile10, double percentile50, double percentile90, double max, PerformanceRunner.ReportLevel reportLevel, boolean showDecimals)` Method that writes the performance report
`void` `writeResults()` Write all records to file in TXT format

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### REPORTS_DIR

    public static final String REPORTS_DIR

See Also:
  Constant Field Values

### Method Detail

#### getOrCreate

    public static ReportLogger getOrCreate(String testSuiteName,
                           String testCaseName,
                           String className,
                           String referenceMethod)

Factory method for ReportRecorder. Will return an existing ReportLogger for given parameters or create a new instance and register it internally.

Parameters:
  `testSuiteName` -
  `testCaseName` -
  `className` -
  `referenceMethod` -
Returns:

#### writeReport

    public static void writeReport(String testSuiteName,
                   String testCaseName,
                   String className,
                   String methodName,
                   org.apache.commons.math.stat.descriptive.DescriptiveStatistics statistics,
                   ReportLogger.ReportType reportType,
                   PerformanceRunner.ReportLevel reportLevel)
                            throws Exception

Method the writes the performance report after a test is run

Parameters:
  `testSuiteName` -
  `testCaseName` -
  `className` -
  `methodName` -
  `statistics` -
  `reportType` -
  `reportLevel` -
Throws:
  `Exception`

#### writeReportTxt

    public static void writeReportTxt(String testSuiteName,
                      String testCaseName,
                      String className,
                      String methodName,
                      org.apache.commons.math.stat.descriptive.DescriptiveStatistics statistics,
                      PerformanceRunner.ReportLevel reportLevel)
                               throws Exception

Method the writes the performance report after a test is run, in text format

Parameters:
  `testSuiteName` -
  `testCaseName` -
  `className` -
  `methodName` -
  `statistics` -
  `reportLevel` -
Throws:
  `Exception`

#### writeReportTxt

    public static void writeReportTxt(String testSuiteName,
                      String testCaseName,
                      String className,
                      String methodName,
                      double min,
                      double percentile10,
                      double percentile50,
                      double percentile90,
                      double max,
                      PerformanceRunner.ReportLevel reportLevel)
                               throws Exception

Method that writes the performance report

Parameters:
  `testSuiteName` -
  `testCaseName` -
  `className` -
  `methodName` -
  `min` -
  `percentile10` -
  `percentile50` -
  `percentile90` -
  `max` -
  `reportLevel` -
Throws:
  `Exception`

#### writeReportTxt

    public static void writeReportTxt(String testSuiteName,
                      String testCaseName,
                      String className,
                      String methodName,
                      double min,
                      double percentile10,
                      double percentile50,
                      double percentile90,
                      double max,
                      PerformanceRunner.ReportLevel reportLevel,
                      boolean showDecimals)
                               throws Exception

Method that writes the performance report

Parameters:
  `testSuiteName` -
  `testCaseName` -
  `className` -
  `methodName` -
  `min` -
  `percentile10` -
  `percentile50` -
  `percentile90` -
  `max` -
  `reportLevel` -
  `showDecimals` -
Throws:
  `Exception`

#### writeAllResults

    public static void writeAllResults()
                                throws Exception

Write results from all registered loggers

Throws:
  `Exception`

#### checkAllThresholds

    public static List<org.junit.runner.notification.Failure> checkAllThresholds()
                                                                          throws ClassNotFoundException

Check all thresholds for all records in all registered loggers

Returns:
Throws:
  `ClassNotFoundException`

#### recordStatistics

    public void recordStatistics(String methodName,
                        org.apache.commons.math.stat.descriptive.DescriptiveStatistics statistics,
                        double threshold)

Record statistics for given method

Parameters:
  `methodName` -
  `statistics` -

#### writeResults

    public void writeResults()
                      throws Exception

Write all records to file in TXT format

Throws:
  `Exception`

#### checkThresholds

    public List<org.junit.runner.notification.Failure> checkThresholds()
                                                                throws ClassNotFoundException

Test if any of the PerformanceRecord exceeds their threshold against the reference

Returns:
Throws:
  `ClassNotFoundException`