Class StackProfiler

java.lang.Object
org.openjdk.jmh.profile.StackProfiler
All Implemented Interfaces:
InternalProfiler, Profiler

public class StackProfiler extends Object implements InternalProfiler
Very basic and naive stack profiler.
  • Field Details

    • IGNORED_THREADS

      private static final String[] IGNORED_THREADS
      Threads to ignore (known system and harness threads)
    • stackLines

      private final int stackLines
    • topStacks

      private final int topStacks
    • periodMsec

      private final int periodMsec
    • sampleLine

      private final boolean sampleLine
    • excludePackageNames

      private final Set<String> excludePackageNames
    • samplingTask

      private volatile StackProfiler.SamplingTask samplingTask
  • Constructor Details

  • Method Details

    • beforeIteration

      public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams)
      Description copied from interface: InternalProfiler
      Run this code before starting the next benchmark iteration.
      Specified by:
      beforeIteration in interface InternalProfiler
      Parameters:
      benchmarkParams - benchmark parameters used for current launch
      iterationParams - iteration parameters used for current launch
    • afterIteration

      public Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result)
      Description copied from interface: InternalProfiler
      Run this code after a benchmark iteration finished
      Specified by:
      afterIteration in interface InternalProfiler
      Parameters:
      benchmarkParams - benchmark parameters used for current launch
      iterationParams - iteration parameters used for current launch
      result - iteration result
      Returns:
      profiler results
    • getDescription

      public String getDescription()
      Description copied from interface: Profiler
      Human-readable one-line description of the profiler.
      Specified by:
      getDescription in interface Profiler
      Returns:
      description
    • dottedLine

      static String dottedLine(String header)