Interface ExternalProfiler

All Superinterfaces:
Profiler
All Known Implementing Classes:
AbstractPerfAsmProfiler, AsyncProfiler, DTraceAsmProfiler, JavaFlightRecorderProfiler, LinuxPerfAsmProfiler, LinuxPerfC2CProfiler, LinuxPerfNormProfiler, LinuxPerfProfiler, SafepointsProfiler, WinPerfAsmProfiler

public interface ExternalProfiler extends Profiler
External profiler: profilers to be run outside of JVM.

External profilers usually call external tools to get the performance data. It is futile to query any internal JVM facilities in external profiler Java code, because it may not be executed in the benchmarked VM at all.

  • Method Details

    • addJVMInvokeOptions

      Collection<String> addJVMInvokeOptions(BenchmarkParams params)
      Prepend JVM invocation with these commands.
      Parameters:
      params - benchmark parameters used for current launch
      Returns:
      commands to prepend for JVM launch
    • addJVMOptions

      Collection<String> addJVMOptions(BenchmarkParams params)
      Add JVM these options to the run.
      Parameters:
      params - benchmark parameters used for current launch
      Returns:
      options to add to JVM launch
    • beforeTrial

      void beforeTrial(BenchmarkParams benchmarkParams)
      Run this code before starting the trial. This method will execute before starting the benchmark JVM.
      Parameters:
      benchmarkParams - benchmark parameters used for current launch
    • afterTrial

      Collection<? extends Result> afterTrial(BenchmarkResult br, long pid, File stdOut, File stdErr)
      Run this code after the trial is done. This method will execute after benchmark JVM had stopped.
      Parameters:
      br - benchmark result that was the result of the trial
      pid - pid that the forked JVM had
      stdOut - file containing the standard output from the benchmark JVM
      stdErr - file containing the standard error from the benchmark JVM
      Returns:
      profiler results
    • allowPrintOut

      boolean allowPrintOut()
      If target VM communicates with profiler with standard output, this method can be used to shun the output to console. Profiler is responsible for consuming the standard output and printing the relevant data from there.
      Returns:
      returns true, if profiler allows harness to print out the standard output
    • allowPrintErr

      boolean allowPrintErr()
      If target VM communicates with profiler with standard error, this method can be used to shun the output to console. Profiler is responsible for consuming the standard error and printing the relevant data from there.
      Returns:
      returns true, if profiler allows harness to print out the standard errpr