Package org.openjdk.jmh.profile
Class StackProfiler
- java.lang.Object
-
- org.openjdk.jmh.profile.StackProfiler
-
- All Implemented Interfaces:
InternalProfiler,Profiler
public class StackProfiler extends java.lang.Object implements InternalProfiler
Very basic and naive stack profiler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classStackProfiler.SamplingTaskprivate static classStackProfiler.StackRecordstatic classStackProfiler.StackResultstatic classStackProfiler.StackResultAggregator
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>excludePackageNamesprivate static java.lang.String[]IGNORED_THREADSThreads to ignore (known system and harness threads)private intperiodMsecprivate booleansampleLineprivate StackProfiler.SamplingTasksamplingTaskprivate intstackLinesprivate inttopStacks
-
Constructor Summary
Constructors Constructor Description StackProfiler(java.lang.String initLine)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<? extends Result>afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result)Run this code after a benchmark iteration finishedvoidbeforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams)Run this code before starting the next benchmark iteration.(package private) static java.lang.StringdottedLine(java.lang.String header)java.lang.StringgetDescription()Human-readable one-line description of the profiler.
-
-
-
Field Detail
-
IGNORED_THREADS
private static final java.lang.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 java.util.Set<java.lang.String> excludePackageNames
-
samplingTask
private volatile StackProfiler.SamplingTask samplingTask
-
-
Constructor Detail
-
StackProfiler
public StackProfiler(java.lang.String initLine) throws ProfilerException- Throws:
ProfilerException
-
-
Method Detail
-
beforeIteration
public void beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams)
Description copied from interface:InternalProfilerRun this code before starting the next benchmark iteration.- Specified by:
beforeIterationin interfaceInternalProfiler- Parameters:
benchmarkParams- benchmark parameters used for current launchiterationParams- iteration parameters used for current launch
-
afterIteration
public java.util.Collection<? extends Result> afterIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams, IterationResult result)
Description copied from interface:InternalProfilerRun this code after a benchmark iteration finished- Specified by:
afterIterationin interfaceInternalProfiler- Parameters:
benchmarkParams- benchmark parameters used for current launchiterationParams- iteration parameters used for current launchresult- iteration result- Returns:
- profiler results
-
getDescription
public java.lang.String getDescription()
Description copied from interface:ProfilerHuman-readable one-line description of the profiler.- Specified by:
getDescriptionin interfaceProfiler- Returns:
- description
-
dottedLine
static java.lang.String dottedLine(java.lang.String header)
-
-