Class JSONResultFormat

java.lang.Object
org.openjdk.jmh.results.format.JSONResultFormat
All Implemented Interfaces:
ResultFormat

class JSONResultFormat extends Object implements ResultFormat
  • Field Details

    • out

      private final PrintStream out
  • Constructor Details

    • JSONResultFormat

      public JSONResultFormat(PrintStream out)
  • Method Details

    • writeOut

      public void writeOut(Collection<RunResult> results)
      Specified by:
      writeOut in interface ResultFormat
    • getRawData

      private String getRawData(RunResult runResult, boolean histogram)
    • emitParams

      private String emitParams(BenchmarkParams params)
    • emitPercentiles

      private String emitPercentiles(Statistics stats)
    • emit

      private String emit(double[] ds)
    • emit

      private String emit(double d)
    • toJsonString

      static String toJsonString(String s)
      Escaping for a JSON string. Does the typical escaping of double quotes and backslash. Also escapes characters that are handled by the tidying process, so that every ASCII character makes it correctly into the JSON output. Control characters are filtered.
    • tidy

      static String tidy(String s)
    • printMultiple

      private String printMultiple(Collection<String> elements, String leftBracket, String rightBracket)
    • printStringArray

      private static void printStringArray(PrintWriter pw, Collection<String> col)