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 class
StackProfiler.SamplingTask
private static class
StackProfiler.StackRecord
static class
StackProfiler.StackResult
static class
StackProfiler.StackResultAggregator
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.String>
excludePackageNames
private static java.lang.String[]
IGNORED_THREADS
Threads to ignore (known system and harness threads)private int
periodMsec
private boolean
sampleLine
private StackProfiler.SamplingTask
samplingTask
private int
stackLines
private int
topStacks
-
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 finishedvoid
beforeIteration(BenchmarkParams benchmarkParams, IterationParams iterationParams)
Run this code before starting the next benchmark iteration.(package private) static java.lang.String
dottedLine(java.lang.String header)
java.lang.String
getDescription()
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:InternalProfiler
Run this code before starting the next benchmark iteration.- Specified by:
beforeIteration
in 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:InternalProfiler
Run this code after a benchmark iteration finished- Specified by:
afterIteration
in 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:Profiler
Human-readable one-line description of the profiler.- Specified by:
getDescription
in interfaceProfiler
- Returns:
- description
-
dottedLine
static java.lang.String dottedLine(java.lang.String header)
-
-