Interface StartupStepRecorder
- All Superinterfaces:
AutoCloseable, Service, StaticService
Records named
StartupStep spans during CamelContext startup to capture timing and
diagnostic information for troubleshooting and performance analysis.
Each step is opened with beginStep(Class, String, String) and closed with endStep(StartupStep), forming a tree of nested spans that
mirrors the initialization call graph. The default implementation is a no-op; the camel-jfr module provides
an implementation that writes events to the Java Flight Recorder (JFR) event stream, enabling correlation with JVM
profiling data in tools such as JDK Mission Control.
The recorder is started automatically when the context starts and stopped (or kept running, depending on
setStartupRecorderDuration(long)) once startup completes. Use steps() to iterate over captured steps
after startup for programmatic analysis.- Since:
- 3.8
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionBeings a new step.voidendStep(StartupStep step) Ends the stepintTo filter our sub steps at a maximum depth@Nullable String@Nullable StringlongHow long time to run the startup recorder.booleanWhether recording is enabledbooleanWhether to start flight recorder recording.voidsetEnabled(boolean enabled) Whether recording is enabledvoidsetMaxDepth(int level) To filter our sub steps at a maximum depthvoidsetRecording(boolean recording) Whether to start flight recorder recording.voidsetRecordingDir(String recordingDir) Directory to store the recording.voidsetRecordingProfile(String profile) To use a specific Java Flight Recorder profile configuration, such as default or profile.voidsetStartupRecorderDuration(long startupRecorderDuration) How long time to run the startup recorder.default Stream<StartupStep> steps()Some records will capture all steps which can be accessed on demand.
-
Field Details
-
FACTORY
-
-
Method Details
-
isEnabled
boolean isEnabled()Whether recording is enabled -
setEnabled
void setEnabled(boolean enabled) Whether recording is enabled -
getStartupRecorderDuration
long getStartupRecorderDuration()How long time to run the startup recorder. Use 0 (default) to stop the recorder after Camel has been started. Use -1 to keep the recorder running until Camel is being stopped. A positive value is to run the recorder for N seconds. -
setStartupRecorderDuration
void setStartupRecorderDuration(long startupRecorderDuration) How long time to run the startup recorder. Use 0 (default) to stop the recorder after Camel has been started. Use -1 to keep the recorder running until Camel is being stopped. A positive value is to run the recorder for N seconds. -
getRecordingDir
@Nullable String getRecordingDir() -
setRecordingDir
Directory to store the recording. By default, the current directory will be used. -
getRecordingProfile
@Nullable String getRecordingProfile() -
setRecordingProfile
To use a specific Java Flight Recorder profile configuration, such as default or profile. The default is default. -
setMaxDepth
void setMaxDepth(int level) To filter our sub steps at a maximum depth -
getMaxDepth
int getMaxDepth()To filter our sub steps at a maximum depth -
setRecording
void setRecording(boolean recording) Whether to start flight recorder recording. This is only in use if camel-jfr is being used. -
isRecording
boolean isRecording()Whether to start flight recorder recording. This is only in use if camel-jfr is being used. -
beginStep
Beings a new step.Important must call
endStep(StartupStep)to end the step.- Parameters:
type- the sourcename- name of the stepdescription- description of the step
-
endStep
Ends the step -
steps
Some records will capture all steps which can be accessed on demand.
-