util
Class StackSampler
java.lang.Object
util.Sampler
util.StackSampler
- All Implemented Interfaces:
- Runnable
public class StackSampler
- extends Sampler
A minimal pure Java sampling profiler.
Due to biased placement of yield points. Samples will be
biased towards code that contains many such points [1]. Can't
do much about this problem with a pure Java sampler.
[1] Mytkowicz, Diwan, Hauswirth, Sweeney. "Evaluating the Accuracy of Java Profilers." PLDI 2010
Constructor Summary |
protected |
StackSampler(int intervalMillis)
|
Method Summary |
protected StackStatistics |
dumpSamples()
Returns the statistics associated with this sampler. |
protected void |
sample()
Takes a sample at the interval. |
static Sampler |
start(int interval)
Start sampling with this sampler. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
includeMethodName
public static final String includeMethodName
- Only include stack traces that contain this method name.
- See Also:
- Constant Field Values
StackSampler
protected StackSampler(int intervalMillis)
sample
protected void sample()
- Description copied from class:
Sampler
- Takes a sample at the interval.
- Specified by:
sample
in class Sampler
dumpSamples
protected StackStatistics dumpSamples()
- Description copied from class:
Sampler
- Returns the statistics associated with this sampler.
- Specified by:
dumpSamples
in class Sampler
- Returns:
- statistics
start
public static Sampler start(int interval)
- Start sampling with this sampler.
- Parameters:
interval
- sample interval in milliseconds
- Returns:
- a sampler