public abstract class InstrumentingProfiler extends Profiler
The profiler may support starting recording multiple times for a given JVM. The implementation should indicate this by overriding canRestartRecording(ScenarioSettings).
| Modifier and Type | Class and Description |
|---|---|
static interface |
InstrumentingProfiler.SnapshotCapturingProfilerController |
| Constructor and Description |
|---|
InstrumentingProfiler() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
canRestartRecording(ScenarioSettings settings)
Can this profiler implementation restart recording, for the same JVM?
|
protected abstract InstrumentingProfiler.SnapshotCapturingProfilerController |
doNewController(ScenarioSettings settings) |
protected abstract JvmArgsCalculator |
jvmArgsWithInstrumentation(ScenarioSettings settings,
boolean startRecordingOnProcessStart,
boolean captureSnapshotOnProcessExit)
Creates JVM args to instrument that JVM with the given capabilities enabled.
|
ProfilerController |
newController(java.lang.String pid,
ScenarioSettings settings)
Creates a controller for this profiler.
|
JvmArgsCalculator |
newInstrumentedBuildsJvmArgsCalculator(ScenarioSettings settings)
Calculates the JVM args for measured builds.
|
JvmArgsCalculator |
newJvmArgsCalculator(ScenarioSettings settings)
Calculates the JVM args for all builds, including warm-ups.
|
void |
validate(ScenarioSettings settings,
java.util.function.Consumer<java.lang.String> reporter) |
protected void |
validateMultipleDaemons(ScenarioSettings settings,
java.util.function.Consumer<java.lang.String> reporter) |
protected void |
validateMultipleIterationsWithCleanupAction(ScenarioSettings settings,
java.util.function.Consumer<java.lang.String> reporter) |
isCreatesStacksFiles, newGradleArgsCalculator, newInstrumentedBuildsGradleArgsCalculator, summarizeResultFilepublic JvmArgsCalculator newJvmArgsCalculator(ScenarioSettings settings)
When the daemon will not be reused, this does nothing as there is no need to instrument the warm-up builds in this case.
When the daemon will be reused for all builds, then instrument the daemon but do not start recording or capture snapshots yet. Recording and capture will be enabled later when the measured builds run.
newJvmArgsCalculator in class Profilerpublic JvmArgsCalculator newInstrumentedBuildsJvmArgsCalculator(ScenarioSettings settings)
When the daemon will be reused for all builds, this does nothing as the daemon is already instrumented (above).
When using a cold daemon, start the JVM with recording enabled but do not capture snapshots yet.
When using no daemon, start the JVM with recording enabled and capture a snapshot when the JVM exits.
newInstrumentedBuildsJvmArgsCalculator in class Profilerpublic ProfilerController newController(java.lang.String pid, ScenarioSettings settings)
When the daemon will be reused for all builds, create a controller that starts and stops recording when requested, and that captures a snapshot at the end of the session.
When using a cold daemon, create a controller that stops recording and captures a snapshot when requested, but does not start recording as this is already enabled when the JVM starts.
When using no daemon, return a controller that finishes the session only, as recording and snapshot capture are already enabled when the JVM starts.
newController in class Profilerpublic void validate(ScenarioSettings settings, java.util.function.Consumer<java.lang.String> reporter)
protected void validateMultipleIterationsWithCleanupAction(ScenarioSettings settings, java.util.function.Consumer<java.lang.String> reporter)
protected void validateMultipleDaemons(ScenarioSettings settings, java.util.function.Consumer<java.lang.String> reporter)
protected boolean canRestartRecording(ScenarioSettings settings)
protected abstract JvmArgsCalculator jvmArgsWithInstrumentation(ScenarioSettings settings, boolean startRecordingOnProcessStart, boolean captureSnapshotOnProcessExit)
protected abstract InstrumentingProfiler.SnapshotCapturingProfilerController doNewController(ScenarioSettings settings)