Class BenchmarkResult

java.lang.Object
org.teavm.perf.BenchmarkResult

public final class BenchmarkResult extends Object
Result of running a single benchmark with particular mode and parameters, either obtained by running benchmark or read from a JMH JSON file.
  • Constructor Details

    • BenchmarkResult

      public BenchmarkResult(String source, String sourceDescription, String benchmark, String mode, Map<String,String> params, String unit, List<List<Double>> rawData)
      Creates result and computes score and error from raw data.
      Parameters:
      source - identifier of the source of results, e.g. name of a backend.
      mode - JMH short label of the mode, e.g. avgt.
      rawData - scores of measurement iterations, grouped by forks.
    • BenchmarkResult

      public BenchmarkResult(String source, String sourceDescription, String benchmark, String mode, Map<String,String> params, String unit, List<List<Double>> rawData, double score, double error)
      Creates result with explicitly given score and error. When score is NaN, it's computed from raw data.
  • Method Details

    • getSource

      public String getSource()
    • getSourceDescription

      public String getSourceDescription()
    • getBenchmark

      public String getBenchmark()
    • getMode

      public String getMode()
    • getParams

      public Map<String,String> getParams()
      Benchmark parameters, sorted by name.
    • getUnit

      public String getUnit()
    • getRawData

      public List<List<Double>> getRawData()
    • getScore

      public double getScore()
    • getError

      public double getError()
    • getStatistics

      public Statistics getStatistics()
    • getBackend

      public String getBackend()
      Name of TeaVM backend that produced the result or null if result is not produced by TeaVM (e.g. read from JSON produced by JMH).
    • setBackend

      public void setBackend(String backend)
    • getMetadata

      public Map<String,Object> getMetadata()
      Additional fields of JMH JSON format, like number of iterations, iteration time, etc.
    • getKey

      public String getKey()
      Key that identifies benchmark, mode and parameters, used to match results from different sources.